• 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

How do I add post info to pages?

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 › How do I add post info to pages?

This topic is: resolved

Tagged: .post-info, page

  • This topic has 13 replies, 6 voices, and was last updated 11 years, 9 months ago by jeremyers1.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • June 12, 2013 at 11:37 am #45505
    mathiasppc
    Member

    I tried adding this to functions.php:

    //* Customize the post info function
    add_filter( 'genesis_post_info', 'post_info_filter' );
    function post_info_filter($post_info) {
    $post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
    return $post_info;
    }

    I also tried swapping genesis_post_info with genesis_entry_header, but with no luck

     

    Thanks for any comments 🙂

    http://energyinformative.org/
    June 12, 2013 at 12:05 pm #45509
    David Chu
    Participant

    Deleted... I misunderstood the question.


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    June 18, 2013 at 12:29 pm #46594
    mathiasppc
    Member

    Anyone have a solution for this problem?

    June 21, 2013 at 12:42 pm #47082
    mathiasppc
    Member

    Bump

    June 22, 2013 at 6:46 pm #47237
    Ozzy
    Member

    what is it you're trying to do with it?


    Ozzy Rodriguez | Twitter | Google+

    June 22, 2013 at 6:52 pm #47238
    mathiasppc
    Member

    I I just want the post info (author, date and comments) to show up on pages (as it`s already showing up in posts)

    June 23, 2013 at 1:33 am #47268
    tibor
    Member

    Since the genesis_post_info function does not run on pages, you would have to add it to the page first:

    Adding this to your page template (page.php) may do the trick:

    add_action( 'genesis_after_post_title', 'my_page_info' );
    function my_page_info() {
    	
    	$post_info = '[post_date] ' . __( 'by', 'genesis' ) . ' [post_author_posts_link] [post_comments] [post_edit]';
    	printf(  '<div class="post-info">%s</div>', do_shortcode( $post_info )  );
    }
    
    June 23, 2013 at 10:59 am #47295
    mathiasppc
    Member

    Thanks Tibor!

    Do I put this in the page.php in the Genesis Framework though? I thought I was not supposed to edit those files?

    June 23, 2013 at 12:22 pm #47297
    tibor
    Member

    You should indeed never edit any Genesis core files. If you want this on all your pages, just add a new file named page.php to your child theme folder and Genesis will use that instead of it's own.

    It should look like this:

    <?php
    add_action( 'genesis_after_post_title', 'my_page_info' );
    function my_page_info() {
    	
    	$post_info = '[post_date] ' . __( 'by', 'genesis' ) . ' [post_author_posts_link] [post_comments] [post_edit]';
    	printf( '<div class="post-info">%s</div>', do_shortcode( $post_info ) );
    }
    
    genesis();
    

    You could also use it in functions.php, but then you'd first have to check if you're on a page post-type.

    Actually you might want to see how Genesis uses the post-info function: look in genesis/lib/structure/post.php, at or around line 252

    June 23, 2013 at 1:13 pm #47307
    mathiasppc
    Member

    Thanks again Tibor

    Here`s what I put in functions.php

    if ( is_page() ) {
    add_action( 'genesis_entry_header', 'my_page_info' );
    function my_page_info() {
    $post_info = '[post_date] ' . __( 'by', 'genesis' ) . ' [post_author_posts_link] [post_comments] [post_edit]';
    printf( '<p class="entry-meta">%s</p>', do_shortcode( $post_info ) );
    }
    }

    It doesent work because I think theres something wrong with the if-statement? Without if ( is_page() ) the extra post info shows up on all posts and pages.

    June 23, 2013 at 1:37 pm #47319
    Brad Dalton
    Participant

    The conditional needs to be added after the function or it won't work.

    Code tested and works on Genesis 2.0 HTML 5 Sample child theme.


    Tutorials for StudioPress Themes.

    June 23, 2013 at 2:01 pm #47329
    mathiasppc
    Member

    Thanks for the help everyone. Working beautifully!

    September 16, 2013 at 4:46 pm #62897
    jeremyers1
    Member

    I am trying to do this also. I added this to my functions.php file:

    function my_page_info() {
    $post_info = '[post_date] ' . __( 'by', 'genesis' ) . ' [post_author_posts_link] [post_comments] [post_edit]';
    printf( '<p class="entry-meta">%s</p>', do_shortcode( $post_info ) );
    }

    if ( is_page() ) {
    add_action( 'genesis_entry_header', 'my_page_info' );
    }

    But nothing is appearing on my pages. Any help?


    Blogger and Author

    September 16, 2013 at 5:02 pm #62901
    jeremyers1
    Member

    Thanks for the code above by braddalton. Didn't see it before. That worked.


    Blogger and Author

  • 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

© 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