Forums

[resolved] Showing date on single post pages when posts are in any category EXCEPT id=3 (3 posts)

  1. jamesmddd
    Member
    Posted 2 years ago #

    Hiya,

    I want to use this code:

    <?php twentyten_posted_on(); ?>

    to display the date on any single post page, except when the category is id=3....

    I tried using in_category but couldn't get it to work...

    any ideas?

    thanks!

  2. davidandre
    Member
    Posted 2 years ago #

    Hiya,
    if <?php twentyten_posted_on(); ?> is inside the loop try:
    <?php if ( !in_category('3') ): ?>
    <?php twentyten_posted_on(); ?>
    <?php endif; ?>

    if outside the loop.
    <?php
    $post = $wp_query->post;
    if ( !in_category('3') ) {
    twentyten_posted_on();

    }
    ?>

    not sure 100% but never know:)
    bye

  3. jamesmddd
    Member
    Posted 2 years ago #

    great, thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic