show categories dynamically and display categories post items on click of it
-
<ul class=”portfolio-categ filter”>
<?php
$args = array(
‘show_option_all’ => ”,
‘orderby’ => ‘name’,
‘order’ => ‘ASC’,
‘style’ => ‘list’,
‘show_count’ => 0,
‘hide_empty’ => 1,
‘use_desc_for_title’ => 1,
‘child_of’ => 0,
‘feed’ => ”,
‘feed_type’ => ”,
‘feed_image’ => ”,
‘exclude’ => ”,
‘exclude_tree’ => ”,
‘include’ => ”,
‘hierarchical’ => 1,
‘title_li’ => __( ‘Categories’ ),
‘show_option_none’ => __( ” ),
‘number’ => null,
‘echo’ => 1,
‘depth’ => 0,
‘current_category’ => 0,
‘pad_counts’ => 0,
‘taxonomy’ => ‘category’,
‘walker’ => null
);
wp_list_categories( $args );
?><div class=”clearfix”>
</div>
<div class=”row”>
<section id=”projects”>
<ul id=”thumbs” class=”portfolio”><?php query_posts( $args );
if (have_posts()) :
while (have_posts()) : the_post();if ( has_post_thumbnail() ) :
the_post_thumbnail();$category = get_the_category();
?>
<!– Item Project and Filter Name –>
<li class=”item-thumbs col-lg-3 design” data-id=”id-0″ data-type=”<?php echo $category; ?>”>
<!– Fancybox – Gallery Enabled – Title – Full Image –>
“>
<span class=”overlay-img”></span>
<span class=”overlay-img-thumb font-icon-plus”></span>
<!– Thumb Image and Description –>
<img src=”<?php bloginfo(‘url’); ?>/wp-content/uploads/category-images/<?php echo $category[0]->category_nicename ; ?>-150×150.jpg” alt=”<?php the_title(); ?>” /><!– End Item Project –>
<?php endif; endwhile;
endif;
wp_reset_query(); ?>
- The topic ‘show categories dynamically and display categories post items on click of it’ is closed to new replies.