Support » Fixing WordPress » Hide Author for some posts!?

  • Hi to all best members.

    I want to excloude the author tag from all posts only in one of my categories.

    In my single.php i use the [<?php the_author(); ?>] tag.
    It show the author tag in post of all of my categories.

    Its good, but i have one of these categories that not need to show the author.

    How can I hide or exclude or add this tag only from posts in one categories.

    Is there a plugin that make a button in my #quicktags caled “post author” for example !???

    Or can I assign ivisible author or assign author for a special posts…

Viewing 3 replies - 1 through 3 (of 3 total)
  • You could put the_author inside this code bit:
    <?php $post = $wp_query->post; if ( !in_category('1') ) { ?>
    <?php the_author(); ?>
    <?php } ?>

    Then it’ll show the author’s name if NOT in category so-and-so (change the number 1 to the correct category ID)
    I tested it out on my blog so it should work

    Edit Actually just
    <?php if ( !in_category('1') ) { ?>
    <?php the_author(); ?>
    <?php } ?>

    works fine too

    some ideas:

    for exaple if the author is “admin” the system dont display the author tag.

    or to have a checkbox in write a post section caled sohw hide author!??

    some help

    Thank you very much Minna its works very good.

    Good bless you 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide Author for some posts!?’ is closed to new replies.