Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1162713

    Paul R
    Moderator

    Hi,

    You can try this third party plugin.

    https://wordpress.org/plugins/all-in-one-schemaorg-rich-snippets/

    Hope that helps.

    #1165961

    Bark201
    Participant

    Ok, I am seeing the errors are increasing so Im not sure if the code I used fixes it. I used that plugin in the past and that didnt help much. In the past I had TwentyFourteen, I think this is the code I used to fix it. Can you please provide a similar code for theme x, integrity with the author?

    if ( ! function_exists( 'twentyfourteen_posted_on' ) ) :
    /**
    * Print HTML with meta information for the current post-date/time and author.
    *
    * @since Twenty Fourteen 1.0
    *
    * @return void
    */
    function twentyfourteen_posted_on() {
    if ( is_sticky() && is_home() && ! is_paged() ) {
    echo '<span class="featured-post">' . __( 'Sticky', 'twentyfourteen' ) . '</span>';
    }
    
    // Set up and print post meta information.
    printf( 'UPDATED <span class="entry-date updated"><a href="%1$s" rel="bookmark"><time class="entry-date updated" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>',
    esc_url( get_permalink() ),
    esc_attr( get_the_modified_date( 'c' ) ),
    esc_html( get_the_modified_date() ),
    esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    get_the_author()
    );
    }
    endif;
    #1166116

    Rue Nel
    Moderator

    Hello There,

    Using the same code, you ca update it and use this instead:

    if ( ! function_exists( 'twentyfourteen_posted_on' ) ) :
    /**
    * Print HTML with meta information for the current post-date/time and author.
    *
    * @since Twenty Fourteen 1.0
    *
    * @return void
    */
    function twentyfourteen_posted_on() {
      if ( is_sticky() && is_home() && ! is_paged() ) {
        echo '<span class="featured-post">' . __( 'Sticky', 'twentyfourteen' ) . '</span>';
      }
    
      if ( is_single() ) {
        // Set up and print post meta information.
        printf( 'UPDATED <span class="entry-date updated"><a href="%1$s" rel="bookmark"><time class="entry-date updated" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>',
        esc_url( get_permalink() ),
        esc_attr( get_the_modified_date( 'c' ) ),
        esc_html( get_the_modified_date() ),
        esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
        get_the_author()
        );
      }
    }
    add_filter('the_content', 'twentyfourteen_posted_on');
    
    endif;

    Please let us know if this works out for you.

    #1166234

    Bark201
    Participant

    Thanks for the code but I am using your theme now and not TwentyFourteen. The code you gave still has TwentyFourteen in it. Can you please provide the function code for integrity theme so I can get the updated and missing author errors fixed in google webmaster?

    #1166517

    Bark201
    Participant

    I just want to make sure that code you gave will work even though I am not using TwentyFourteen anymore.

    #1166675

    Jade
    Moderator

    Hi there,

    Please try this:

    if ( ! function_exists( 'x_posted_on' ) ) :
    
    function twentyfourteen_posted_on() {
      if ( is_sticky() && is_home() && ! is_paged() ) {
        echo '<span class="featured-post">' . __( 'Sticky', '__x__' ) . '</span>';
      }
    
      if ( is_single() ) {
        // Set up and print post meta information.
        printf( 'UPDATED <span class="entry-date updated"><a href="%1$s" rel="bookmark"><time class="entry-date updated" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>',
        esc_url( get_permalink() ),
        esc_attr( get_the_modified_date( 'c' ) ),
        esc_html( get_the_modified_date() ),
        esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
        get_the_author()
        );
      }
    }
    add_filter('the_content', 'x_posted_on');
    
    endif;

    Hope this helps.

    #1166744

    Bark201
    Participant

    Thank you, I will know in a few days if that worked

    #1166786

    Nico
    Moderator

    Feel free to let us know how it goes.

    Thanks.

    #1173024

    Bark201
    Participant

    I am still waiting for the strucutured data to be updated. I did notice entry-title for pages are missing for pages I disabled the page title in. Does disabling the page title removes it or makes it hidden? If it removes it, will putting this in the css do the job if I enable the page title again inside pages?

    .page-id-XXXX .entry-title {display: none;}

    #1173599

    Jade
    Moderator

    Hi there,

    Disabling the page title option would remove the title in the actual markup and yes, the code you have provided will still have the title in the markup but will hide it in the page.

    #1174440

    Bark201
    Participant

    Thank you. I would consider making the disable page title hidden rather than removing it completely because it could damages the SEO of the given page. I will make the required changes. I still dont know if the other code fixed the missing updated and missing author,

    #1174724

    Joao
    Moderator

    Hi There,

    Let us know if you need further help,

    Joao

    #1184387

    Bark201
    Participant
    This reply has been marked as private.
    #1184433

    Paul R
    Moderator

    Hi,

    Can you provide us the exact url of the two new posts.

    Thanks

    #1184452

    Bark201
    Participant
    This reply has been marked as private.