• Skip to primary navigation
  • Skip to main content

Genesis Community

Resources for Genesis WordPress Theme Users

  • Facebook
  • Twitter
  • Slack
  • Wiki
  • Login
You are here: Home / Wikis / Genesis / Conditionally remove post info for certain authors

Conditionally remove post info for certain authors

add_filter( 'genesis_post_info', 'prefix_remove_post_info_for_specific_authors' );
/**
 * Conditionally remove post info for certain authors.
 *
 * @param string $post_info Genesis post info shortcodes.
 * @return string
 */
function prefix_remove_post_info_for_specific_authors( $post_info ) {
    // Add the author IDs to this array.
    $hide_meta_for_authors = [ 4, 12, 20 ];

    $current_author = get_the_author_meta( 'ID' );

    if ( in_array( $current_author, $hide_meta_for_authors, true ) ) {
        return '';
    }

    return $post_info;
}
Source: https://genesiswp.slack.com/files/U0JLYFSNB/F9M0U2MLH/hide_author_meta.php

Posted by: Sridhar Katakam Category: Genesis Tags: tim jensen

« Add Search as a list item in the Primary Nav
Remove all actions’ loop hooks »

Copyright © 2026 · Genesis Sample on Genesis Framework · WordPress · Log in