• Resolved lucid_design

    (@lucid_design)


    This question relates to coding the archive.php file.

    I want the name of the category parent, category child or tag to display on the page above the list of posts. Don’t know how to encode that.

    On the single.php file, the post title is noted as <?php the_title(); ?>

    I experimented with that for accessing the category or tag name, but no luck.

    Here’s one of my archive pages. I want the Category name (in this case, ‘Quotes’) to appear under the olive green flourish.

    https://albereo.com/melanie/category/quotes/

    Thanks to anyone with a solution.

Viewing 2 replies - 1 through 2 (of 2 total)
  • if you have a copy of the kubrick default theme, see in their archive.php how it can be done.

    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
     	  <?php /* If this is a category archive */ if (is_category()) { ?>
    		<h2 class="pagetitle">Archive for the ‘<?php single_cat_title(); ?>’ Category</h2>
     	  <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    		<h2 class="pagetitle">Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
     	  <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    		<h2 class="pagetitle">Archive f...............
    Thread Starter lucid_design

    (@lucid_design)

    Thank you, worked perfectly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I display the Category or Tag name on the Archives page?’ is closed to new replies.