Show author byline on some categories

Community Forums Forums General Discussion Show author byline on some categories

This topic is: not resolved

Tagged: , ,

This topic contains 8 replies, has 2 voices, and was last updated by  braddalton 1 year, 2 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #38796

    Josh Fialkoff
    Participant
    Post count: 22

    Hi,

    How can I add a filter to show the author byline on just some categories?

    For instance, I want to show the byline on blog posts, but not on news category posts.

    Thanks,

    Josh

    http://www.wlfarm.org
    #38800

    braddalton
    Participant
    Post count: 8797

    You can use either CSS to hide it or a remove action with conditional tags including the page/post i.d’s you want to remove it from. http://my.studiopress.com/snippets/post-info/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #38803

    Josh Fialkoff
    Participant
    Post count: 22

    Hi Brad,

    Thanks for your quick reply.

    I don’t see information on this page about how to filter by category.

    Please let me know what I am missing…

    Thanks for your help!

    #38805

    braddalton
    Participant
    Post count: 8797

    You’ll need to modify the code or use CSS. I have written about this in a couple of posts so I can provide the code tomorrow.

    The conditional tag to filter by category is [php]!in_category[/php] check the Codex

    You would use this code in a custom function with the conditional tag:
    [php]remove_action( ‘genesis_before_post_content’, ‘genesis_post_info’ );
    [/php]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #38806

    Josh Fialkoff
    Participant
    Post count: 22

    Awesome! Thanks so much for your help.

    #38910

    braddalton
    Participant
    Post count: 8797

    Could you please reply me with the categories you want excluded. thanks


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #38911

    Josh Fialkoff
    Participant
    Post count: 22

    Thanks. We did it already. We actually just want to *include* the Blog category.

    #38912

    Josh Fialkoff
    Participant
    Post count: 22

    We added this to the Simple Hooks plugin:

    <?php
    if(in_category(‘blog’ ))
    ?>
    <div class=”post-info”>
    <?php
    if(in_category(‘blog’ ))
    echo’
    <span class=”time”>’;?><?php if(in_category(‘blog’ )) the_time(‘F j, Y’); ?></span> <span class=”author”>

    <?php if(in_category(‘blog’ ))
    echo’by ‘; if(in_category(‘blog’ )) the_author(); ?></span>
    </div>

    #38917

    braddalton
    Participant
    Post count: 8797

    Good stuff.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

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

You must be logged in to reply to this topic.