Community Forums › Forums › Archived Forums › General Discussion › How to display Author and date on pages
- This topic has 6 replies, 3 voices, and was last updated 11 years, 11 months ago by
tobyhage.
-
AuthorPosts
-
January 7, 2014 at 3:39 pm #83877
tobyhage
MemberHello,
On my pages the author and date are not displayed, i don't know why. See for example: http://www.vlieginfo.com/reisverzekering/
On my posts and custom post type pages author and date are displayed. See for example: http://www.vlieginfo.com/vliegtickets/rome/
Hopefully someone can help me, because i'am searching half a day for a solution and cannot find it.
Thanks in advance
http://www.vlieginfo.com/January 7, 2014 at 3:52 pm #83880RobG
MemberTry adding this to your function.php file it may also require a bit of CSS to customize the color for your font as well.
I would think your theme would have this function already unless it was removed.//* Customize the post info function add_filter( 'genesis_post_info', 'sp_post_info_filter' ); function sp_post_info_filter($post_info) { if ( !is_page() ) { $post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]'; return $post_info; }}
To speed up the process please post the link to the website in question.
We recommend using Firebug to view source codes http://getfirebug.com/
RobGoss WordPress Developer
We build WordPress websites for your business or personal goals
http://www.robgoss.com / Follow me Twitter / https://twitter.com/robgossJanuary 7, 2014 at 4:05 pm #83882tobyhage
MemberHello Rob,
Thank you for the fast response. But this is not what i needed. I do want to display the author and date on pages.
The genesis_post_info is not executed on pages only on posts.Do you have another suggestion?
January 7, 2014 at 4:53 pm #83905RobG
MemberWhat theme are you using?
To speed up the process please post the link to the website in question.
We recommend using Firebug to view source codes http://getfirebug.com/
RobGoss WordPress Developer
We build WordPress websites for your business or personal goals
http://www.robgoss.com / Follow me Twitter / https://twitter.com/robgossJanuary 7, 2014 at 4:57 pm #83907tobyhage
MemberI made it myself.
January 8, 2014 at 1:15 am #83950Genesis Developer
MemberAdd this code in your functions.php file
add_action( 'genesis_entry_header', 'genesis_page_info', 18 ); add_filter( 'genesis_page_info', 'do_shortcode', 20 ); function genesis_page_info() { global $post; if (is_page()): $post_info = apply_filters( 'genesis_page_info', '[post_date] ' . __( 'by', 'genesis' ) . ' [post_author_posts_link]' ); genesis_markup( array( 'html5' => sprintf( '<p class="entry-meta">%s</p>', $post_info ), 'xhtml' => sprintf( '<div class="post-info">%s</div>', $post_info ), ) ); endif; }
January 8, 2014 at 3:51 am #83957tobyhage
MemberThank you very much. It was more difficult than i thought!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.