Site logo

Archived topic

missing updated time

9 replies · Started by david on April 12, 2017

Viewing posts 1–10 of 10

hello! i just bought this premium features and on my way to customize.

i am asking for displaying date to visitor but not google here

with code you give, here's my date displayed,
before before
after

i want to keep before for visitor information. how can i do that?

yes tom, but after i implement your code the after works, i still want the before work (posted on and update on displayed)

Ah, try this:

add_filter( 'generate_post_date_output','tu_remove_date_microdata' );
function tu_remove_date_microdata() {
	$time_string = '<time class="entry-date published">%2$s</time>';
	if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
		$time_string .= '<time class="updated">%4$s</time>';
	}

	$time_string = sprintf( $time_string,
		esc_attr( get_the_date( 'c' ) ),
		esc_html( get_the_date() ),
		esc_attr( get_the_modified_date( 'c' ) ),
		esc_html( get_the_modified_date() )
	);
	
	printf( 
		'<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
		esc_url( get_permalink() ),
		esc_attr( get_the_time() ),
		$time_string
	);
}

i merge the codes you gave to me before and it works. thank you.

You're welcome :)

Hello Tom,

Google Searchconsole is telling me, that all my pages related to pictures and from my implemented glossar plug does not show microformat updated. error: "following missing: updated"
Number is increasing and is starting since I am using your theme.

Examples are this page
https://www.ledclusive.de/blog/lighting-passport-von-asensetek-im-test/china-led-spectrometer-lighting-passport-spektrum/

it shows this result.
https://search.google.com/structured-data/testing-tool?url=https://www.ledclusive.de/blog/glossar/farbkonsistenz/#url=https%3A%2F%2Fwww.ledclusive.de%2Fblog%2Flighting-passport-von-asensetek-im-test%2Fchina-led-spectrometer-lighting-passport-spektrum%2F

or for glossar item
https://search.google.com/structured-data/testing-tool?url=https://www.ledclusive.de/blog/glossar/farbkonsistenz/#url=https%3A%2F%2Fwww.ledclusive.de%2Fblog%2Fglossar%2Ffarbkonsistenz%2F

Any idea, what I can do?

Hello Tom,

yes, all items are switched on.
Must say, that at normal posts it works. only the posts created by the glossary plugin and picture pages as individuell link does not work.

Ah yes, the standard author/date is only added to the "post" post type. Any chance you can create a new topic on this as it's a different issue? I'll be able to help with some code :)

This archived topic is closed to new replies.