Comments Section Missing

Hello There,

To hide the hentry, please update your code in to this:

/* 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" 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></div>' ;
} else {
return $content;
}
}
/* Fix "Missing Author" and "Missing Updated" issue – END */

Or you can simply use this custom css without editing the php code in the child theme’s functions.php file. Just please add the following CSS code in the X > Theme Options > Global CSS (http://prntscr.com/evui3r)

.hatom-extra {
  display: none;
}

We would loved to know if this has work for you. Thank you.

Thanks. I have one other problem with the hentry. It doesn’t apply to my blog or tag pages and idea how I can get the hentry for them adjusting the code?

Also it appears the the entry-title data is still missing from my pages. Can you recheck the code because I don’t thinks its collecting the data.

Thank you

Hey @quituck,

Blog and Tag pages are archive pages and the given code was for single post type. Try adding the is_archive Conditional Tag to the code provided previously like this:

if (is_singular() || is_single() || is_archive())

If you’re using a Blank page template, there is no page title and because of that, there’s no entry-title. You can achieve a hidden entry-title by adding this to your functions.php

/* Add entry-title to Blank Page Templates */
function add_entry_title_to_blank_pages($content) {
  if ( is_page_template( array('template-blank-1.php', 'template-blank-2.php', 'template-blank-3.php', 'template-blank-4.php', 'template-blank-5.php', 'template-blank-6.php', 'template-blank-7.php', 'template-blank-8.php' ) ) ) {
  return '<span class="visually-hidden entry-title">' . get_the_title() . '</span>' . $content;
  } else {
    return $content;
  }
} /* Add entry-title to Blank Page Templates */

The visually-hidden class hides that from the page.

Hope that helps.

Thank you. I will try it out and see how it goes.

You’re welcome.

So I don’t know if that hentry worked because my blog page is still missing AUTHOR and UPDATED hentry tags. Also I noticed that the tags don’t appear at the bottom of the page like it does that rest.

Please advise

Try adding is_home() to the condition like this if (is_singular() || is_single() || is_archive() || is_home())

Thanks.

Thank you. I will try this out and let you know how it goes.

No problem.
Please let us know if this works out for you.

So that didn’t work. I’m not sure what going on with these hentrys.

I’m still missing the author, entry-title, and updated on my blog page.

And most of my other pages are only missing entry-titles, provided the code you game me.

The code worked on the posts. But this page thing is an issues.

Hi,

You can try this code instead

/* Fix "Missing Author" and "Missing Updated" issue – START */
add_action('x_before_the_content_end','custom_author_code');

function custom_author_code() {
if (is_singular() || is_single() || is_archive() || is_home()) {
echo '<div class="hatom-extra" 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></div>' ;
} 
}
/* Fix "Missing Author" and "Missing Updated" issue – END */

Hope this helps

Just to be clear this is the code I’m using

/* 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() || is_archive() || is_home()) {
return $content .

’. get_the_title() .’ was last modified: ‘. get_the_modified_time(‘F jS, Y’) .’ by ‘. get_the_author() .’
’ ;
} else {
return $content;
}
}
/* Fix “Missing Author” and “Missing Updated” issue – END */

/* Add entry-title to Blank Page Templates /
function add_entry_title_to_blank_pages($content) {
if ( is_page_template( array(‘template-blank-1.php’, ‘template-blank-2.php’, ‘template-blank-3.php’, ‘template-blank-4.php’, ‘template-blank-5.php’, ‘template-blank-6.php’, ‘template-blank-7.php’, ‘template-blank-8.php’ ) ) ) {
return ‘’ . get_the_title() . ‘’ . $content;
} else {
return $content;
}
} /
Add entry-title to Blank Page Templates */

/* Fix “Missing Author” and “Missing Updated” issue – START */
add_action(‘x_before_the_content_end’,‘custom_author_code’);

function custom_author_code() {
if (is_singular() || is_single() || is_archive() || is_home()) {
echo ‘

’. get_the_title() .’ was last modified: ‘. get_the_modified_time(‘F jS, Y’) .’ by ‘. get_the_author() .’
’ ;
}
}
/* Fix “Missing Author” and “Missing Updated” issue – END */

Hi There,

Please update your code to this:

add_filter( 'the_content', 'custom_hatom_code_single');
function custom_hatom_code_single($content) {
	if ( is_singular() ) {
		return $content .
	'<div class="hatom-extra" 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></div>' ;
	} else {
		return $content;
	}
}

add_action('x_after_view_global__index','custom_hatom_code');
function custom_hatom_code() {
if ( is_archive() || is_home() ) {
	echo '<div class="hatom-extra" 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></div>' ;
	} 
}

Let us know if it works for you!

So, I just checked to see if those errors were fixed. They are still there.

Hello There,

Could you please update the code and use this:

add_filter( 'the_content', 'custom_hatom_code_single');
function custom_hatom_code_single($content) {
	if ( is_singular() ) {
		return $content .
	'<div class="hatom-extra" 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></div>' ;
	} else {
		return $content;
	}
}

add_action('the_excerpt','custom_hatom_code');
function custom_hatom_code() {
if ( is_archive() || is_home() ) {
	echo '<div class="hatom-extra" 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></div>' ;
	} 
}

Hope this helps.

Okay. I just updated my functions php. I will let you know how it works out.

Thank you.

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