• Resolved talino

    (@talino)


    Hi all,

    I’m editing my template, and I would like WP to not display the date below the title if the post belongs to a certain category.

    I found this line in the index.php file of the template :


    <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

    This is the one I would like skipped, only when a post matches a certain category. Is this possible to do?

    Also, is it possible, along the same lines, to not display a post at all in the main page, but only list it when the user is viewing its assigned category?

    Thanks a lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I think you could use the in_category tag for the first part of your problem, and just make the line of index.php that you identified appear only when a post belongs to certain categories. See this page for details of usage.

    Thread Starter talino

    (@talino)

    Thanks a lot. Worked like a charm. I’m just starting to discover how flexible WP is…

    Cheers.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Category-dependent PHP functions’ is closed to new replies.