Tagged: x
-
AuthorPosts
-
April 27, 2016 at 5:58 am #901888
cjerrymeParticipantHi. the code below has partially fixed the errors:
add_filter(‘get_the_excerpt’, ‘modified_date_updated_excerpt’);
function modified_date_updated_excerpt( $excerpt ) {
if ( !is_single() || !is_singular() ) {
return $excerpt . ‘<br><div class=”hatom-extra hidden” style=”display: none;”><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><br><br></div>’;
} else {
return $excerpt;
}
}add_filter(‘the_content’, ‘modified_date_updated_content’);
function modified_date_updated_content( $content ) {
if ( !is_singular( ‘x-portfolio’ ) ) {
return $content . ‘<br><div class=”hatom-extra hidden” style=”display: none;”><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;
}
}Unresolved Issues:
1. HOWEVER, this does not fix the issue on category pages. Google still reports that author and updated information are missing from category pages. Is there a way to apply the code in category pages as well?
2. The code makes the data invisible to human eye. However in pages where the recent posts shortcode is placed, the data are displayed. Is it possible to set the data hidden also on such pages?
Thanks.
April 27, 2016 at 1:48 pm #902816
JadeModeratorHi Jerry,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
April 27, 2016 at 4:24 pm #903061
cjerrymeParticipantThis reply has been marked as private.April 28, 2016 at 6:00 am #903868
Paul RModeratorHi,
1. I checked your category pages and I can see the code being added to it.
http://screencast.com/t/x7tmIFIC
Can you try checking again.
2. Can you provide us the url of the page where we can see the issue.
I checked on the homepage and it is not showing up.
http://screencast.com/t/1Feh1CSNqCW
Thanks
April 28, 2016 at 7:54 am #904015
cjerrymeParticipantThis reply has been marked as private.April 28, 2016 at 8:21 pm #904997
Rue NelModeratorHello There,
It is not invisible because the html codes where strip off. Please have your code updated and use this instead:
add_filter('the_excerpt', 'modified_date_updated_excerpt'); function modified_date_updated_excerpt( $excerpt ) { if ( !is_single() || !is_singular() ) { return $excerpt . '<br><div class="hatom-extra hidden" style="display: none;"><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><br><br></div>'; } else { return $excerpt; } }Please let us know if this works out for you.
April 28, 2016 at 8:59 pm #905042
cjerrymeParticipanthi.
It works.
Thanks.
🙂
April 29, 2016 at 11:01 am #905833
DarshanaModeratorGlad we were able to help 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-901888 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
