• 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

swann83

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
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • September 6, 2018 at 12:28 pm in reply to: How to display author name only on posts from specific categories #223021
    swann83
    Member

    Ok, I wrote this and it works.

    add_filter( 'genesis_post_info', 'post_info_filter' );
    function post_info_filter($post_info) {
    if ( in_category( array( 10,2640,4678,7084 ) ) AND ( is_single() ) ) {
    $post_info = 'di <em>[post_author]</em> <br/> [post_date] [post_comments] [post_edit]';
    } else {
    $post_info = '[post_date] [post_comments] [post_edit]';
    }
    return $post_info;
    }

    Thank you so much for your time, braddalton.

    Swann.

    September 6, 2018 at 10:18 am in reply to: How to display author name only on posts from specific categories #223016
    swann83
    Member

    Thank you, braddalton. I appreciate it.

    I'm sorry my English isn't good enough. I haven't been able to make it quite clear that I have very limited technical knowledge. I'm fairly satisfied with the current configuration, but it would be best if I could display the entry meta with authors name on single posts only (from those categories) and the standard entry meta without authors name (only date, comments and edit) in the entry header, including front and blog pages.

    Thanks,

    Swann

    September 6, 2018 at 6:24 am in reply to: How to display author name only on posts from specific categories #223008
    swann83
    Member

    Sorry, how do I do that? The first method seems to be fine.

    add_filter( 'genesis_post_info', 'post_info_filter' );
    function post_info_filter($post_info) {
    
    if ( in_category( array( 10,2640,4678,7084 ) )  ) {
    $post_info = 'di <em>[post_author]</em> <br/> [post_date] [post_comments] [post_edit]';
    return $post_info;
    } else {
    $post_info = '[post_date] [post_comments] [post_edit]';
    return $post_info;
    }
    
    }

    I just want the author name not to be visible in the homepage.

    Thanks.

    September 6, 2018 at 6:08 am in reply to: How to display author name only on posts from specific categories #223006
    swann83
    Member

    https://www.ilveggente.it/

    September 6, 2018 at 5:03 am in reply to: How to display author name only on posts from specific categories #223002
    swann83
    Member

    Great! It works.

    What can I do to keep only author name from being displayed in excerpts in the homepage? I want to display it just in the single post view.

    Thanks,

    Swann

    September 6, 2018 at 3:05 am in reply to: How to display author name only on posts from specific categories #222994
    swann83
    Member

    Ok, it works only if I declare it once. If I use both of these codes then an error occurs: Cannot redeclare post_info_filter() (previously declared in....

    add_filter( 'genesis_post_info', 'post_info_filter' );
    function post_info_filter($post_info) {
    $post_info = '[post_date] [post_comments] [post_edit]';
    return $post_info;
    }

    add_filter( 'genesis_post_info', 'post_info_filter' );
    function post_info_filter($post_info) {

    if ( in_category('f1') ) {
    $post_info = '[post_author] [post_date] [post_comments] [post_edit]';
    return $post_info;
    }

    }

    As I said I need [post_date] + [post_comments] + [post_edit] to be displayed in all categories and posts, by default, and also [post_author] in all posts from only two categories (F1 and News). And by the way, I need that info (post author) to be displayed just in the default output of single posts, not visible below the excerpts in the homepage.

    Thanks,

    Swann

    September 5, 2018 at 7:57 am in reply to: How to display author name only on posts from specific categories #222946
    swann83
    Member

    I have Simple Hooks, that is very important for my site. Is it creating conflicts? How can I solve them?

    September 5, 2018 at 7:00 am in reply to: How to display author name only on posts from specific categories #222943
    swann83
    Member

    Unfortunately, it doesn't work:

    add_filter( 'genesis_post_info', 'post_info_filter' );
    if ( in_category('f1') ) {
    $post_info = '[post_author] [post_date] [post_comments] [post_edit]';
    return $post_info;
    }

    Any idea what I'm doing wrong here?

    Thanks.

    September 4, 2018 at 12:15 pm in reply to: How to display author name only on posts from specific categories #222929
    swann83
    Member

    Yes, thank you.

    This is exactly my customization in my theme’s functions.php file:

    add_filter( 'genesis_post_info', 'post_info_filter' );
    function post_info_filter($post_info) {
    $post_info = '[post_date] [post_comments] [post_edit]';
    return $post_info;
    }

    I've tried to add this ("f1" is the category whose posts I want the author name to be displayed in) but it doesn't work:

    add_filter( 'genesis_post_info', 'post_info_filter' );
    if ( is_category('f1') ) {
    $post_info = '[post_author] [post_date] [post_comments] [post_edit]';
    return $post_info;
    }

    I'm not sure I'm good enough to use conditional tags but anyway I don't know if it could work for my purpose (I want author name not to be displayed in the homepage, above excerpts, but just in the single post).

    Thanks.

    April 14, 2017 at 12:08 am in reply to: How can I manually change posts order in my homepage? #204769
    swann83
    Member

    That drag & drop feature actually exists in "Post Types Order" plugin, but it doesn't seem to work with Genesis.
    null

    April 13, 2017 at 3:31 am in reply to: How can I manually change posts order in my homepage? #204721
    swann83
    Member

    Thank you for the answer. Well, I don't need a different sorts parameter. I just need a kind of drag and drop feature to re-order my posts arrangement day by day, without changing date – 'cause this would change permalink and produce lost pages and disadvantage in organic search results. I remember a drag and drop feature like that, used in newspaper magazine website (built in WP) I worked for.

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 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