WordPress.org

Ready to get started?Download WordPress

Forums

Category Description in Archives page (Hemingway) (4 posts)

  1. bohoe
    Member
    Posted 7 years ago #

    Im trying to get the "category description" to show in the archives.php page underneath "Articles in 'Only in Ireland'". Please have a look to this link: http://singularity.bohoe.com/archives/category/only-in-ireland/
    (Im using Hemingway)

    I have tried a couple of things and read in the forum but cant seem to get it right.

    I would like to show it as follows:

    <?php if (have_posts()) : ?>
    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    <h1>Articles in '<?php echo single_cat_title(); ?>'</h1>
    [AND THE CAT_DESCRIPTION CODE TO SHOW HERE]

    Anyone?
    If there is a post resolving this, I missed it, so let me know.

  2. DMCunningham
    Member
    Posted 7 years ago #

    The following works for me when I need to show the category description for the category.

    <?php if (have_posts()) : ?>
    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    <h1>Articles in '<?php echo single_cat_title(); ?>'</h1>
    <p><?php echo category_description(single_cat_title()); ?></p>

  3. Spid
    Member
    Posted 7 years ago #

    Thank you, thats just what I was looking for myself.

    One thing, when it brings up the description, its showing the catagory title name again, without any spacing after it, is there a way of this not showing on this line?

    I know its probably something simple, but I'm not that great with php.

    Thanks in advance.

  4. Spid
    Member
    Posted 7 years ago #

    I've sorted it, now, sorry to trouble anyone reading. :)

Topic Closed

This topic has been closed to new replies.

About this Topic