Display category name in template
-
Display current category name in template
Is there is a way to get the current category name in the template.
$cat = get_category( get_query_var( ‘cat’ ) );
$category = $cat->slug;
echo do_shortcode(‘[ajax_load_more post_type=”post”]’);<li <?php if (!has_post_thumbnail()) { ?> class=”no-img”<?php } ?>><?php if ( has_post_thumbnail() ) { the_post_thumbnail(array(100,100));}?><h3>” title=”<?php the_title(); ?>”><?php the_title(); ?></h3><p class=”entry-meta”><?php the_time(“F d, Y”); ?></p><?php the_excerpt(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Display category name in template’ is closed to new replies.