Remove author from post info on specific category

Community Forums Forums Design Tips and Tricks Remove author from post info on specific category

This topic is: not resolved

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  John 2 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #5439

    johnkwhite
    Participant

    I want to hide the author info on post pages if a certain category is selected. Any easy solutions?

    • This topic was modified 2 years ago by  johnkwhite. Reason: Fixed formatting
    • This topic was modified 2 years ago by  johnkwhite. Reason: Fixed formatting
    #5447

    John
    Participant
    Post count: 157

    John,

    To clarify, are you wanting to remove the author info on a category archive page that displays posts from a certain category? Or on a single post that is in a certain category?

    John


    John Sundberg | blackhillswebworks.com
    A WordPress developer’s toolbox: Firebug | WordPress Codex | Google ;)

    #5486

    johnkwhite
    Participant

    Sorry, should have been more clear. The latter. I’m curating stories from other sites in a category called “curated” and I want any post tagged with that to only show the date it was posted.

    Cheers.

    #5664

    johnkwhite
    Participant

    Figured it out. Used Genesis Simple Hooks plug in. Went to genesis_before_post_content Hook and added:

    <?php if(in_category(‘curated’)) { ?>
    <p>
    <?php echo get_the_date(‘M. j, Y’); ?></p>
    <?php  } else { ?>
    <p>by <span><?php echo get_the_author(); ?></span>
    <?php echo get_the_date(‘M. j, Y’); ?></p>
    <?php } ?>

    #5721

    John
    Participant
    Post count: 157

    Nicely done, thanks for the update!


    John Sundberg | blackhillswebworks.com
    A WordPress developer’s toolbox: Firebug | WordPress Codex | Google ;)

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Remove author from post info on specific category’ is closed to new replies.