• Resolved muumuse

    (@muumuse)


    Hi,

    I can’t seem to add categories to my single posts. I’ve tried different code (I figured adding <?php the_category(‘, ‘); ?> would do the trick right under the_author, but I guess not).

    Can anyone please help? Is there some other piece that I’m missing?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter muumuse

    (@muumuse)

    Bumpy.

    Thread Starter muumuse

    (@muumuse)

    Anyone? Site is muumuse.com.

    <?php the_category(', '); ? is the correct template tag to use.

    Thread Starter muumuse

    (@muumuse)

    Okay…it’s in my Single template as below, but nothing shows up. Any ideas?

    <center><h1><?php the_title(); ?></h1></center>
    <p class=”post_author”>by <?php the_author(); ?></p>
    <?php the_category(‘, ‘); ?>
    <div class=”format_text”>

    Thread Starter muumuse

    (@muumuse)

    Just found something–it’s displaying the labels when you click into an individual story, but not on the main page.

    Could be a css issue with the category list inadvertently being hidden. You’ve got a validation error on the code you posted:

    <center><h1><?php the_title(); ?></h1></center>

    should be

    <h1 style="text-align:center"><?php the_title(); ?></h1>

    If there are other validation errors on the page, they could also be impacting on the category display.

    Site url?

    Thread Starter muumuse

    (@muumuse)

    You’ve been looking at the wrong template file. single.php controls the display of single posts. Now you need to add <?php the_category(', '); ?> to index.php and archive.php. Also category.php and tag.php if you have those files too.

    Thread Starter muumuse

    (@muumuse)

    WORKED. Thank you so much, Esmi.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Categories Do Not Display in Post’ is closed to new replies.