<div class="memphis memphis_01 memphis_left"></div>

<div class="max-width">

	<div class="left">
		<h8>

	<?php $category = get_the_category(); 

if($category[0]->cat_name == "featured") {

    //if first category in array is "featured", get next category in line

     $name = $category[1]->cat_name;
     $cat_id = get_cat_ID( $name );
     $link = get_category_link( $cat_id );
     echo 'Mais '. $name .'';

} else {

    //get the first category

     $name = $category[0]->cat_name;
     $cat_id = get_cat_ID( $name );
     $link = get_category_link( $cat_id );
     echo 'Mais '. $name .'';

} ?>

 </h8>
	</div>
	
	<div class="right">
	<?php $category = get_the_category(); 

if($category[0]->cat_name == "featured") {

    //if first category in array is "featured", get next category in line

     $name = $category[1]->cat_name;
     $cat_id = get_cat_ID( $name );
     $link = get_category_link( $cat_id );
     echo '<a href="'. esc_url( $link ) .'"">Mostrar tudo em '. $name .'</a>';

} else {

    //get the first category

     $name = $category[0]->cat_name;
     $cat_id = get_cat_ID( $name );
     $link = get_category_link( $cat_id );
     echo '<a href="'. esc_url( $link ) .'"">Mostrar tudo em '. $name .'</a>';

} ?>
	</div>
	
<div class="clear"></div>

<?php
    global $post;
    if(is_category() || is_single()){
    foreach(get_the_category() as $category)
    {
    $current = $category->cat_ID;
    $current_name = $category->cat_name;

    //query_posts("cat=". $current);

    $myposts = get_posts(array('category__in' => array($current)));

    //$myposts = get_posts('numberposts=50&category='.$current); 

    //query_posts(array('category__in' => array(11)));
        }
    }

    foreach($myposts as $post) :
    setup_postdata($post); 

	get_template_part('loop/loop-excerpt'); 

	endforeach; ?>


	
</div>