• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Show author byline on some categories

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Show author byline on some categories

This topic is: not resolved

Tagged: blog, byline, category

  • This topic has 13 replies, 4 voices, and was last updated 11 years, 5 months ago by democracychronicles.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • May 1, 2013 at 12:45 pm #38796
    Josh Fialkoff
    Member

    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
    May 1, 2013 at 1:00 pm #38800
    Brad Dalton
    Participant

    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/


    Tutorials for StudioPress Themes.

    May 1, 2013 at 1:04 pm #38803
    Josh Fialkoff
    Member

    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!

    May 1, 2013 at 1:07 pm #38805
    Brad Dalton
    Participant

    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

    !in_category

    check the Codex

    You would use this code in a custom function with the conditional tag:

    remove_action( 'genesis_before_post_content', 'genesis_post_info' );
    

    Tutorials for StudioPress Themes.

    May 1, 2013 at 1:08 pm #38806
    Josh Fialkoff
    Member

    Awesome! Thanks so much for your help.

    May 2, 2013 at 7:20 am #38910
    Brad Dalton
    Participant

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


    Tutorials for StudioPress Themes.

    May 2, 2013 at 7:40 am #38911
    Josh Fialkoff
    Member

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

    May 2, 2013 at 7:41 am #38912
    Josh Fialkoff
    Member

    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>

    May 2, 2013 at 8:24 am #38917
    Brad Dalton
    Participant

    Good stuff.


    Tutorials for StudioPress Themes.

    August 11, 2014 at 7:33 pm #118314
    democracychronicles
    Member

    Hi I have the same problem,

    How can I add a filter to show the author byline on just some categories? Is there CSS that can accomplish this? I don't use Genesis Simple Edits plugin. I would like to only show the byline for one category:

    http://www.democracychronicles.com/category/blogs/

    Thanks,

    Adrian
    democracychronicles.com

    August 11, 2014 at 9:04 pm #118319
    Brad Dalton
    Participant

    Use the in_category(array( your comma separated cat i.d's here) conditional http://wpsites.net/web-design/modify-post-info-genesis/


    Tutorials for StudioPress Themes.

    August 12, 2014 at 1:30 am #118343
    johndu
    Member

    thanx @braddalton

    August 12, 2014 at 1:31 am #118344
    johndu
    Member

    August 28, 2014 at 4:51 pm #121582
    democracychronicles
    Member

    Thank you for your wonderful help and sorry I took so long!. I fixed the problem by adding this to my functions.php

    add_filter( 'genesis_post_info', 'remove_post_info_exclude_news_category' );
    function remove_post_info_exclude_news_category($post_info) {
    if ( in_category('blogs') ) {
    $post_info = '[post_date] by [post_author_posts_link] [post_edit]';
    return $post_info;
    }
    }

  • Author
    Posts
Viewing 14 posts - 1 through 14 (of 14 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble