• <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> 
    
                                    <?php
    
                                        $custom = get_post_custom($post->ID);
    
                                        $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large'); 
    
                                        $cat = get_the_category($post->ID); 
    
                                    ?>
    
                                    <?php $cur_terms = get_the_terms( $post->ID, 'portfolio-category'); 
    
    										foreach($cur_terms as $cur_term){  
    
    									};
    
    									$catt = get_the_terms( $post->ID, 'portfolio-category');
    
    									$slugg = ''; 
    
    									foreach($catt  as $vallue=>$key){
    
    										$slugg .= strtolower($key->slug) . "";
    
    									}
    
    								?>
    
                                        <div class="span4 portfolio_item block <?php echo $slugg; ?> "data-filter="">
    
                                            <div class="view view-first <?php if ($oi_data['portfolio_image_hover_icons'] == "Zoom icon only") { ?>nolink <?php } ?> <?php if ($oi_data['portfolio_image_hover_icons'] == "Link icon only") { ?>noinfo <?php } ?>">
    
                                                <a href="<?php echo $large_image_url[0]; ?>" rel="prettyPhoto"><img src="<?php echo $large_image_url[0]; ?>" alt="" /></a>
    
                                                <div class="mask">
    
                                                    <?php if ($oi_data['portfolio_image_hover_icons'] == "Zoom icon + Link icon") { ?>
    
                                                    <a href="<?php echo $large_image_url[0]; ?>" rel="prettyPhoto" title="<?php the_title(); ?>" class="info"></a>
    
                                                    <a href="<?php echo get_permalink(); ?>" class="link"></a>
    
                                                    <?php } ?>
    
                                                    <?php if ($oi_data['portfolio_image_hover_icons'] == "Zoom icon only") { ?>
    
                                                    <a href="<?php echo $large_image_url[0]; ?>" rel="prettyPhoto" title="<?php the_title(); ?>" class="info"></a>
    
                                                    <?php } ?>
    
                                                    <?php if ($oi_data['portfolio_image_hover_icons'] == "Link icon only") { ?>
    
                                                    <a href="<?php echo get_permalink(); ?>" class="link"></a>
    
                                                    <?php } ?>

    these codes display all the portfolios in a single page. I have 3 sample portfolios with different category each. What i want to achieve is to show only the portfolio of a certain category. What should i do? I’m not familiar with functions like get_post_custom…etc.

  • The topic ‘filtering posts’ is closed to new replies.