Tagged: x
-
AuthorPosts
-
August 10, 2016 at 11:44 am #1125832
garlicfoxParticipantHello,
I was just wondering if this is something I’ve miss-configured or if it’s a theme problem. Google search console is reporting errors (see attached image) on the /articles/ page but each post is showing that these authorship items are included and there were no problems, so it appears only to be on the /articles/ page where we have a summary of each article.
Is there a way I can satisfy the google gods and get this error fixed up? Not sure if this is a theme modification (which i’m running a child theme already so editing it should be pretty easy)..
thanks and much appreciated.
August 10, 2016 at 11:45 am #1125834
garlicfoxParticipantThis reply has been marked as private.August 10, 2016 at 12:02 pm #1125862
RahulModeratorHey There,
Thanks for writing in!
You can follow this thread regarding your Google Search Console Errors :
Hope it helps!
August 15, 2016 at 9:48 am #1131941
garlicfoxParticipantHello,
I followed that code and I still can’t seem to get it to show. I’ll put some screenshots below of the code changes I made to the x-child functions.php theme. I’ve also cleared out all my cache and still not having any luck.
I was wondering if you had any suggestions (screenshots in the next private post below)
Much appreciated.
August 15, 2016 at 9:49 am #1131945
garlicfoxParticipantThis reply has been marked as private.August 15, 2016 at 10:54 am #1132074
RupokMemberHi there,
Can you paste the whole code here? Kindly wrap with code from the Toolbar to prevent unwanted formatting.
Cheers!
August 15, 2016 at 6:01 pm #1132613
garlicfoxParticipantSure! If it makes any difference I’m using the renew stack.
// Structure Data Fix // ========================== //add hatom data function add_suf_hatom_data($content) { $t = get_the_modified_time('F jS, Y'); $author = get_the_author(); $title = get_the_title(); if (is_home() || is_singular() || is_archive() ) { $content .= '<div class="hatom-extra" style="display:none;visibility:hidden;"><span class="entry-title">'.$title.'</span> was last modified: <span class="updated"> '.$t.'</span> by <span class="author vcard"><span class="fn">'.$author.'</span></span></div>'; } return $content; } add_filter('the_content', 'add_suf_hatom_data'); add_filter('the_content', 'modified_date_updated_content'); function modified_date_updated_content( $content ) { if ( !isset($_GET['cornerstone']) && $_GET['cornerstone'] != 1 && !is_page() && !is_singular( 'x-portfolio' ) ) { return $content . '<br><div class="hatom-extra"><span class="entry-title">'. get_the_title() .'</span> was last modified: <span class="updated"> '. get_the_modified_time('F jS, Y') .'</span> by <span class="author vcard"><span class="fn">'. get_the_author() .'</span></span><br><br></div>'; } else { return $content; } }August 16, 2016 at 4:11 am #1133206
RadModeratorHi there,
That code is only applicable on single posts since blog home page doesn’t have the_content filter. Please add this code too,
function remove_hentry_class( $classes ) { if ( is_home() ) { $classes = array_diff( $classes, array( 'hentry' ) ); } return $classes; } add_filter( 'post_class', 'remove_hentry_class', 999 );Hope this helps.
August 16, 2016 at 6:43 am #1133375
garlicfoxParticipantHello,
Sorry I think there is some confusion. I actually want the missing: author + updated to be showing but with data. I don’t want to remove them as I want these pages to have structure data, so how would I get this data in there? Would I use xtheme for that or another plugin?
August 16, 2016 at 5:36 pm #1134263
RadModeratorHi there,
I’m not sure why you need author data on non-post page. The error is there because of the existence of hentry, and google crawler expect data within it. Even if you add author data on blog home page, but it’s outside of hentry block then the same error will persist. Hence, let’s remove hentry then add your author data to the footer.
function remove_hentry_class( $classes ) { if ( is_home() ) { $classes = array_diff( $classes, array( 'hentry' ) ); } return $classes; } add_filter( 'post_class', 'remove_hentry_class', 999 ); // Structure Data Fix // ========================== //add hatom data function add_suf_hatom_data($content) { $t = get_the_modified_time('F jS, Y'); $author = get_the_author(); $title = get_the_title(); if (is_home() || is_singular() || is_archive() ) { $content .= '<div class="hatom-extra" style="display:none;visibility:hidden;"><span class="entry-title">'.$title.'</span> was last modified: <span class="updated"> '.$t.'</span> by <span class="author vcard"><span class="fn">'.$author.'</span></span></div>'; } if ( is_home() ) echo $content; else return $content; } add_filter('the_content', 'add_suf_hatom_data'); add_action('wp_footer', 'add_suf_hatom_data'); add_filter('the_content', 'modified_date_updated_content'); add_action('wp_footer', 'modified_date_updated_content'); function modified_date_updated_content( $content ) { if ( !isset($_GET['cornerstone']) && $_GET['cornerstone'] != 1 && !is_page() && !is_singular( 'x-portfolio' ) ) { $content .= '<br><div class="hatom-extra"><span class="entry-title">'. get_the_title() .'</span> was last modified: <span class="updated"> '. get_the_modified_time('F jS, Y') .'</span> by <span class="author vcard"><span class="fn">'. get_the_author() .'</span></span><br><br></div>'; if ( is_home() ) echo $content; else return $content; } else { return $content; } }Hope this helps.
August 17, 2016 at 8:53 am #1135196
garlicfoxParticipantThanks it does, and thank you for explaining it. I’ve made all these changes and will report back in a week or so once everything gets re-crawled.
August 17, 2016 at 10:25 am #1135318
RahulModeratorThat’s great!
We will standby for you.
August 17, 2016 at 3:19 pm #1135710
garlicfoxParticipantThis reply has been marked as private.August 17, 2016 at 10:08 pm #1136184
Rue NelModeratorHello There,
Thanks for providing the screenshots and your code. By default, in WordPress without doing anything, the “hentry” class were already added. You can check it here: http://prntscr.com/c74pcr
Now, your first block of code removes the
hentryclass. I am not sure what is your purpose of doing that. Please clarify.Secondly, you have duplicate entry above your page because of your code. If you want to use only once and within the article, please have your code updated and use this instead:
// Structure Data Fix // ========================== //add hatom data function add_suf_hatom_data($content) { $t = get_the_modified_time('F jS, Y'); $author = get_the_author(); $title = get_the_title(); if (is_home() || is_singular() || is_archive() ) { $content .= '<div class="hatom-extra" style="display:none;visibility:hidden;"><span class="entry-title">'.$title.'</span> was last modified: <span class="updated"> '.$t.'</span> by <span class="author vcard"><span class="fn">'.$author.'</span></span></div>'; } if ( is_home() ) echo $content; else return $content; } add_filter('the_content', 'add_suf_hatom_data'); add_filter('the_content', 'modified_date_updated_content'); function modified_date_updated_content( $content ) { if ( !isset($_GET['cornerstone']) && $_GET['cornerstone'] != 1 && !is_page() && !is_singular( 'x-portfolio' ) ) { $content .= '<br><div class="hatom-extra"><span class="entry-title">'. get_the_title() .'</span> was last modified: <span class="updated"> '. get_the_modified_time('F jS, Y') .'</span> by <span class="author vcard"><span class="fn">'. get_the_author() .'</span></span><br><br></div>'; if ( is_home() ) echo $content; else return $content; } else { return $content; } }Hope this helps.
August 18, 2016 at 6:26 am #1136634
garlicfoxParticipantThis reply has been marked as private. -
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1125832 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
