Site logo

Archived topic

post meta not generated

3 replies · Started by Silvio on December 13, 2018

Viewing posts 1–4 of 4

hi,

I am using this code to customize post meta

add_filter( 'generate_post_author', '__return_false' );
add_filter( 'generate_show_comments', '__return_false' );
add_filter( 'generate_show_categories', '__return_false' );
add_filter( 'generate_post_date_output', 'tu_fancy_byline' );
function tu_fancy_byline() {
    printf( ' <span class="byline">%1$s</span>',
        sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%4$s<a href="%1$s" title="%2$s" rel="author"><span class="author-name" itemprop="name">%3$s</span></a></span>',
            esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
            esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ),
            esc_html( get_the_author() ),
            '<img src="/wp-content/uploads/2016/07/silviogulizia-avatar-rotondo.png" alt="" />'
        )
    );

    $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ) );

    printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', // WPCS: XSS ok, sanitization ok.
        esc_html_x( 'Categories', 'Used before category names.', 'generatepress' ),
        $categories_list
    );

    // echo '<span class="reading-time">Tempo di lettura: ADD SHORTCODE</span>';
  
}

whil on the blog page I can see the post meta, on the single post the post meta is not showed.

thanks, I didn't realize the hook was the date.

No problem :)

This archived topic is closed to new replies.