Jump to content

Archived

This topic is now archived and is closed to further replies.

travistsickle

Hentry Error

Recommended Posts

travistsickle
I am getting this error in google console.  When I search for the fix everything I read says it's a theme error.  I'm not sure how to fix it.  I tried to search for the file that is called single.php to see if I can alter the code for a fix but I can't find it.
 
I'm not an expert at all so please provide a fix in laymen terms.
 
Missing: author
Missing: entry-title
Missing: updated
 
and 
 
Missing: Updated

Share this post


Link to post
Share on other sites
Simon

What page are you testing?

Share this post


Link to post
Share on other sites
travistsickle

sicklehunter.com

It's in google console, so it's checking the whole site.

It's all pages.  Not on posts, which makes sense since those have times and authors attached.

I know nothing about code so bear with me.

I did some more searching and it seems that there is some code that tells google there should be a time, date and author on every page.  However, it's only on the posts.  I don't want to display this on the pages so it would seem I need code to do that, or in an edit to tell google, these should not be an author, date or time on this page.

Most of what I can find says to add this type of code to the single.php file but that doesn't seem to exist using the pageslines theme.  I also have no idea how to add this to the function.php as I tried a few times and the site just crashes.

function themeslug_remove_hentry( $classes ) {
    if ( is_page() ) {
        $classes = array_diff( $classes, array( 'hentry' ) );
    }
    return $classes;
}
add_filter( 'post_class','themeslug_remove_hentry' );
 

Share this post


Link to post
Share on other sites
travistsickle

I think I figured it out.

I installed the customize plugin and added the code to that function.php file.

 

Share this post


Link to post
Share on other sites
Simon

You'll only get the author and updated type data on posts .. Pages don't use it.

the Google tool isn't clever enough to distinguish posts and pages it just sees a wp site and thinks it's going to be a blog

Share this post


Link to post
Share on other sites

×