title: Display Portfolio Posts only from certain category with PHP
body: <p>Good Day.</p>
  
  <p>I am using a theme that has a Portfolio. The portfolio currently displays all categories listed. How can I change it to display only certain categories ie. Design and Images?</p>
  
  <p>Here is the code of the Portfolio Template Page</p>
  
  <pre><code>&lt;?php
  /*
  Template Name: Portfolio page
  */
  ?&gt;
  
  &lt;?php get_header(); ?&gt;
  &lt;?php
  global $wp_query;
  $post = $wp_query-&gt;post;
  $gogo_select_portfolio_cat = get_post_meta($post-&gt;ID, 'gogo_select_portfolio_cat', true);
  $gogo_portfolio_items_order = get_post_meta($post-&gt;ID, 'gogo_portfolio_items_order', true);
  $gogo_portfolio_text_no_posts = get_post_meta($post-&gt;ID, 'gogo_portfolio_text_no_posts', true);
  $gogo_select_portfolio_template = get_post_meta($post-&gt;ID, 'gogo_select_portfolio_template', true);
  $gogo_select_portfolio_sidebar_position = get_post_meta($post-&gt;ID, 'gogo_select_portfolio_sidebar_position', true);
  ?&gt;
  
  &lt;div class="block clearfix"&gt;
  
  &lt;header class="box-headline"&gt;
      &lt;h4 class="main-headline"&gt;&lt;?php the_title(); ?&gt;&lt;/h4&gt;
  &lt;/header&gt;
  
  &lt;?php if ($gogo_select_portfolio_template=='portfolio-fourthcol') { 
      load_template(TEMPLATEPATH . '/lib/includes/portfolio/portfolio-4col.php');
  } ?&gt;
  
  &lt;?php if ($gogo_select_portfolio_template=='portfolio-threecol') { 
      load_template(TEMPLATEPATH . '/lib/includes/portfolio/portfolio-3col.php');
  } ?&gt;
  
  &lt;?php if ($gogo_select_portfolio_template=='portfolio-twocol') { 
      load_template(TEMPLATEPATH . '/lib/includes/portfolio/portfolio-2col.php');
  } ?&gt;
  
  &lt;/div&gt;
  
  &lt;?php get_footer();?&gt;.
  </code></pre>
  
  <p><strong>Portfolio-4col.php content:</strong></p>
  
  <pre><code>&lt;ul id="filterOptions" class="horizontal" data-option-key="filter"&gt;
      &lt;li&gt;&lt;a class="selected" href="#filter" data-option-value="*"&gt;Show all&lt;/a&gt;&lt;/li&gt;
      &lt;?php
      $categories=  get_categories('taxonomy=portfolio_cat&amp;title_li='); 
      foreach ($categories as $category){ ?&gt;
      &lt;li&gt;&lt;a href="#filter" data-option-value=".&lt;?php echo $category-&gt;slug;?&gt;" title="Filter by &lt;?php echo $category-&gt;name;?&gt;"&gt;&lt;?php echo $category-&gt;name;?&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;?php }?&gt; 
  &lt;/ul&gt;
  
  &lt;ul class="isotope-holder horizontal four-columns"&gt;
  &lt;?php rewind_posts(); ?&gt;
  &lt;?php
  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  query_posts( array( 
                       'post_type' =&gt; 'portfolio', 
                       'posts_per_page' =&gt; -1,
                       'ignore_sticky_posts' =&gt; 1
                       )
                );
  $postcount = 0;
  if ( have_posts() ) : while ( have_posts() ) : the_post(); $postcount++;?&gt;
  
  &lt;!--Retrieve posts meta from custom post types --&gt;
  &lt;?php
  $gogo_portfolio_short_desc = get_post_meta($post-&gt;ID, 'gogo_portfolio_short_desc', true);
  $gogo_portfolio_video_url = get_post_meta($post-&gt;ID, 'gogo_portfolio_video_url', true);
  $gogo_portfolio_custom_link = get_post_meta($post-&gt;ID, 'gogo_portfolio_custom_link', true);
  $gogo_portfolio_display_image_link = get_post_meta($post-&gt;ID, 'gogo_portfolio_display_image_link', true);
  $gogo_portfolio_display_article_link = get_post_meta($post-&gt;ID, 'gogo_portfolio_display_article_link', true);
  $gogo_portfolio_display_external_link = get_post_meta($post-&gt;ID, 'gogo_portfolio_display_external_link', true); ?&gt;
  
  &lt;li class="element &lt;?php $terms = wp_get_post_terms($post-&gt;ID,'portfolio_cat'); foreach ($terms as $term) {  echo ' ' .$term-&gt;slug. ' '; } ?&gt;"&gt;
  &lt;div class="view view-sixth"&gt;
  &lt;?php if (has_post_thumbnail()) { ?&gt;
  &lt;figure&gt;
  &lt;?php $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
  echo '&lt;img src="'.get_template_directory_uri().'/timthumb.php?src='.$thumbnail[0].'&amp;amp;w=218&amp;amp;h=200&amp;amp;zc=1&amp;amp;q=100&amp;amp;s=1" alt="'.get_the_title().'" /&gt;';?&gt;
  &lt;/figure&gt;
  &lt;?php } ?&gt;
  
  &lt;div class="mask"&gt;
          &lt;header class="box-headline"&gt;
              &lt;?php echo '&lt;h4&gt;&lt;a href="'.get_permalink().'"&gt;'; echo ''.get_the_title().''; echo '&lt;/a&gt;&lt;/h4&gt;'; ?&gt;
          &lt;/header&gt;
      &lt;div class="content"&gt;
          &lt;p&gt;&lt;?php echo $gogo_portfolio_short_desc; ?&gt;&lt;/p&gt;
          &lt;a href="&lt;?php echo get_permalink(); ?&gt;" class="info"&gt;&lt;span&gt;Read More &amp;raquo;&lt;/span&gt;&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/div&gt;
  &lt;/li&gt;
  &lt;?php endwhile; ?&gt;
  &lt;?php else : ?&gt;
  &lt;?php endif; ?&gt;
  &lt;/ul&gt;
  
  &lt;script type="text/javascript"&gt;
  var $j = jQuery.noConflict();
  $j(window).load(function() {
  
  var $jcontainer = $j('ul.isotope-holder');
  
  $jcontainer.isotope({
    itemSelector : '.element',
    resizable: false, // disable normal resizing
    // set columnWidth to a percentage of container width
    masonry: { columnWidth: $jcontainer.width() / 4 }
  });
  
  // update columnWidth on window resize
  $j(window).smartresize(function(){
    $jcontainer.isotope({
      // update columnWidth to a percentage of container width
      masonry: { columnWidth: $jcontainer.width() / 4}
    });
  });
  
  var $joptionSets = $j('#filterOptions'),
      $joptionLinks = $joptionSets.find('a');
  
  $joptionLinks.click(function(){
    var $jthis = $j(this);
    // don't proceed if already selected
    if ( $jthis.hasClass('selected') ) {
      return false;
    }
    var $joptionSet = $jthis.parents('#filterOptions');
    $joptionSet.find('.selected').removeClass('selected');
    $jthis.addClass('selected');
  
    // make option object dynamically, i.e. { filter: '.my-filter-class' }
    var options = {},
        key = $joptionSet.attr('data-option-key'),
        value = $jthis.attr('data-option-value');
    // parse 'false' as false boolean
    value = value === 'false' ? false : value;
    options[ key ] = value;
    if ( key === 'layoutMode' &amp;&amp; typeof changeLayoutMode === 'function' ) {
      // changes in layout modes need extra logic
      changeLayoutMode( $jthis, options )
    } else {
      // otherwise, apply new options
      $jcontainer.isotope( options );
    }
  
    return false;
  });
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Any help will be appreciated</p>
  
  <p>Thank you</p>