CodeHQ

Post by taxonomy term

$terms = wp_get_post_terms( $post->ID , 'type' );

if ( $terms != null ){
 foreach( $terms as $term ) {
	$args = array(
		'post_type' => 'portfolio',
		'posts_per_page' => '3',
		'tax_query' => array (
			array (
				'taxonomy' => 'type',
				'field' => 'slug',
				'terms' =>  $term->slug
			)
		)
	);
	
}}

$query = new WP_Query($args);
$i = 1;
while ( $query->have_posts() ) : $query->
the_post(); 

A WordPress query

A WordPress query that can be amended – like below for different post types/amount of posts/categories etc – codex info here

$args = array(
	'post_type' => 'post',
	'posts_per_page' => '16',
	'orderby' => 'rand'
);

$query = new WP_Query($args);

 $i = 1;

while ( $query->have_posts() ) : $query-> the_post();

WordPress menu

1) Register the menu in your functions.php file (Primary is the ID for the menu, Primary Menu is the name and Theme-name is the name of your theme)

register_nav_menus( array(
    'main_menu' => 'Main Navigation',
    'footer_menu' => 'Footer Menu',
    'legal_menu' => 'Legal Menu',
));

2) Enter this in to the location in your theme file where the menu will go (normally header.php)

<?php wp_nav_menu( array( 'theme_location' => 'primary' ) );?>