- Joined
- Jul 26, 2019
- Messages
- 88
- Likes
- 61
- Degree
- 0
I checked some of those results. It's Javascript and JSON objects being exposed within visible HTML for one of two reasons: 1) They broke their HTML code so everything past the error is rendering or 2) They pasted their JS scripts into<div style="display:none;">
instead of<script>
tags.
Thanks for looking into this, and you're right. To be honest I'm a bit baffled, especially by this one
PHP:
<div style="display:none;">
WP_Query Object
(
[query] => Array
(
[post_type] => producten
[posts_per_page] => 12
[paged] => 1
[post_status] => publish
[orderby] => menu_order
[order] => ASC
[suppress_filters] => 0
)
[query_vars] => Array
( ...
On topic
Google prefers JSON-LD, at least according to their own docs. Would be nice to test this and see what result you'll get with leaving the JSON output from Yoast in tact.
And at the risk of offending you, at the moment I'm thinking of implemente this. Just want to make sure that the theme displays the original date ( if ! ) or displays the changed date when it, well, changed.
For now I prioritize the ( if ) clause, because I expect changes to happen more then leaving the articles "as is."
PHP:
<?php
if ( get_the_modified_time( get_option( 'date_format' ) ) !== get_the_time( get_option( 'date_format' ) ) ) :
?>
<span class="meta meta-modified">
<span class="screen-reader-text"><?php esc_html_e( 'Post modification date', 'themename' ); ?></span>
<a href="<?php the_permalink(); ?>"><?php the_modified_time( get_option( 'date_format' ) ); ?></a>
</span>
<?php
else :
?>
<span class="meta">
<span class="screen-reader-text"><?php esc_html_e( 'Post date', 'themename' ); ?></span>
<a href="<?php the_permalink(); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a>
</span>
<?php
endif;
?>