Tagged: x
-
AuthorPosts
-
October 5, 2016 at 12:54 pm #1203768
ChgrimParticipantHi,
I recently added some code to my theme to fix the google Missing: author and Missing: updated hentry problem. The only catch is that it now writes (article) was last modified: October 5th, 2016 by (owner) on each post. Is there a way to hide those words but still have it for the google hentry problem?
You can see an example here
it actually put it on two different places on that page.
Here is the code I added to the function.php
// Fix “Missing Author” and “Missing Updated” issue – START
// =============================================================================
add_filter( ‘the_content’, ‘custom_author_code’);function custom_author_code($content) {
if (is_singular() || is_single()) {
return $content .
‘<div class=”hatom-extra hidden”><span class=”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></div>’ ;
} else {
return $content;
}
}
// =============================================================================Thanks
ChrisOctober 5, 2016 at 1:50 pm #1203857
DarshanaModeratorHi there,
Thanks for writing in! Try adding the following code instead.
add_filter( 'the_content', 'custom_author_code'); function custom_author_code($content) { if (is_singular() || is_single()) { return $content . '<div class="hatom-extra hidden"><span class="title">'. get_the_title() .' </span> by <span class="author vcard"><span class="fn">'. get_the_author() .'</span></span></div>' ; } else { return $content; } }Hope that helps.
October 5, 2016 at 2:41 pm #1203936
ChgrimParticipantHi!
Thanks for getting back so quickly.
So that tweak changed the wording, but the actual “Canny Review by Nadia Delay” is still visible in the post. Also, it is still in two locations on the post.
Thanks
ChrisOctober 5, 2016 at 6:19 pm #1204143
LelyModeratorHi Chris,
Please also try adding this custom CSS:
.hatom-extra.hidden { display: none; }Hope this helps.
October 5, 2016 at 9:08 pm #1204484
ChgrimParticipantThat worked! You guys rock. This is probably the best customer support I have ever had. Keep it up!
October 5, 2016 at 10:20 pm #1204548
LelyModeratorYou’re welcome and thank you for the kind words!
Cheers!
October 18, 2016 at 6:38 pm #1221465
ChgrimParticipantHi,
One extra question! So google webmaster tools is still showing “Missing: updated” on all of my pages. What code do I need to add so that goes away?
Thanks
ChrisOctober 19, 2016 at 2:37 am #1221940
LelyModeratorHi Chris,
Please try updating the code to this:
add_filter( 'the_content', 'custom_author_code'); function custom_author_code($content) { if (is_singular() || is_single()) { return $content . '<div class="hatom-extra hidden"><span class="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></div>' ; } else { return $content; } }Hope this helps.
October 19, 2016 at 1:39 pm #1222693
ChgrimParticipantThanks!
I added the code and I will let you know after google has had time to crawl it!
You guys rock.
ChrisOctober 19, 2016 at 3:33 pm #1222818
Nabeel AModeratorGlad we could help.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1203768 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
