HEvent missing Author/Updated (enabled snippet, tried various fixes per forums)

I have been back and forth on this and while I understand the basics of it I am not clear what I am doing wrong to not satiate Google’s Structured Data needs for our various pages. As of current I am focused on our events page at http://swampfirerecords.com/calendar/events but intend to also add data for the Artists page after I tackle this.

I have snippets enabled and set for Event on Calendar type posts.

I have filled out the various sub tabs for Snippet

I have in the past created a child theme at the advice of an old post that used a modified function.php (old forum posts stated there was a fix, then unobtainable and most recently Snippet was added.

I could use any help tackling this problem fully as the Structured Data aspect is a huge step towards our site goals.

Please see https://imgur.com/a/rXeQX for Google errors as well as Snippet settings.

Thanks

Hi There,

Thank you for writing in, please follow the suggestion that was provided here (https://theme.co/apex/forum/t/hentry-is-not-working/19795/12)

Hope it helps,
Cheers!

I hope it helps too! I added the code shown below to the child theme’s function.php. I will await Google’s recrawl of the page to update this thread with any changes.

function add_suf_hatom_data($content) {
	$t      = get_the_modified_time('F jS, Y');
	$author = get_the_author();
	$title  = get_the_title();
	
	if (is_page() || 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_excerpt', 'add_suf_hatom_data');

Sure, let us know how it goes :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.