• 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

genesis_post_meta filter hook help

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 › Design Tips and Tricks › genesis_post_meta filter hook help

This topic is: not resolved

Tagged: post meta filter

  • This topic has 2 replies, 3 voices, and was last updated 10 years, 11 months ago by Brad Dalton.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 19, 2014 at 1:42 pm #114954
    clare
    Member

    Hi,
    I am trying to use the "genesis_post_meta" filter hook to modify my site's post meta data. This particular hook is listed as one of the available Genesis filters on http://my.studiopress.com/docs/filter-reference/

    For background, I am using WordPress version 3.9.1 with the Enterprise-Pro 2.0.1 theme. I have a Posts page that is different than the static Front page.

    Currently, my post meta says, for example, "May 7, 2014 by (Edit)". I would like it to say "Written: May 7, 2014".
    So I have added the following code to functions.php to try to achieve this:

    function post_meta_filter($post_meta) {
    if (is_home()) {
    $post_meta = '<p>Written: ' . the_time('F jS, Y') . '</p>';
    return $post_meta;
    }
    }
    add_filter('genesis_post_meta', 'post_meta_filter');

    ...but for some reason, it's not working. The post meta information is unchanged, and I'm not sure why. No errors occur, and the Posts page still loads fine. It's just that the current post meta information doesn't change at all.

    Any help would be greatly appreciated.

    July 19, 2014 at 2:34 pm #114961
    efuller
    Member

    Try using this code:

    function post_meta_filter($post_info) {
    	$post_info = '[post_date format="F jS, Y" label="Written: "]';
    	return $post_info;
    }
    add_filter( 'genesis_post_info', 'post_meta_filter');

    This code will not restrict to the 'homepage' like you had in your original code. Feel free to apply your conditionals as needed.


    I am a web developer

    July 19, 2014 at 2:39 pm #114964
    Brad Dalton
    Participant
    add_filter( 'genesis_post_info', 'sp_post_info_filter' );
    function sp_post_info_filter($post_info) {
    	$post_info = 'Written: [post_date] by [post_author_posts_link] [post_comments] [post_edit]';
    	return $post_info;
    }
    

    Remove the shortcodes you don't want to display.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ 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

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