How to display Author and date on pages

Community Forums Forums General Discussion How to display Author and date on pages

This topic is: resolved

Tagged: ,

This topic contains 6 replies, has 3 voices, and was last updated by  tobyhage 1 year, 7 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #83877

    tobyhage
    Participant

    Hello,

    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/
    #83880

    RobG
    Participant

    Try 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/robgoss

    #83882

    tobyhage
    Participant

    Hello 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?

    #83905

    RobG
    Participant

    What 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/robgoss

    #83907

    tobyhage
    Participant

    I made it myself.

    #83950

    Genesis Developer
    Participant

    Add 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;
    }

    #83957

    tobyhage
    Participant

    Thank you very much. It was more difficult than i thought!

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.