Portfolio Category Filtering

<?php
$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
$args = array( ‘numberposts’ => -1, ‘order’=> ‘DESC’, ‘post_type’ => ‘portfolio’, ‘paged’ => $paged);
$postslist = get_posts( $args );
//print_r($postslist);
//echo count($postslist);
foreach ($postslist as $post) : setup_postdata($post);

$terms = get_the_terms( $post->ID, ‘portfolio’ );

if ( $terms && ! is_wp_error( $terms ) ) :
$term_links = array();
$term_id = array();
foreach ( $terms as $term ) {
$term_links[] = $term->slug;
$term_id[] = $term->term_id;
}

$the_term = join( ” “, $term_links );
?>

<h2>Project Name</h2>
<p>A wonderful serenity has taken possession of my entire soul.</p>

href=”images/portfolio/1.jpg” rel=”portfolio” class=”info

<?php echo $the_term ?>” data-cat=”<?php echo $the_term ?>”>
<img src=”<?php the_field(‘portfolio_thumbnail’, $post->ID); ?>” />

<h2><?php the_title(); ?></h2>
<p><?php the_field(‘short_description’, $post->ID); ?></p>

<a href=”<?php the_field(‘portfolio_big_image’, $post->ID); ?>” rel=”portfolio” class=”info open-imag”>

href=”<?php the_field(‘portfolio_external_link’, $post->ID); ?>” rel=”portfolio” class=”info external”><i class=”fa fa-play”>

<?php endif;
wp_reset_query();
endforeach; ?>

Advertisements

Published by

oudarya

I am a developer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s