Site logo

Archived topic

tooltip over post date shows time ???

5 replies · Started by Axel on May 10, 2017

Viewing posts 1–6 of 6

just stumbled upon this: when hovering over a post date the tooltip shows the time.
settings are to only show the date - no more.

somehow this makes absolutely no sense. is there a simple way to change it?
e.g. showing the date in in tooltip or showing nothing at all?

thanks.

You can use filters to change the output:

add_filter( 'generate_post_date_output', 'tu_date_remove_time_tooltip' );
function tu_date_remove_time_tooltip() {
	$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>';
	if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
		$time_string .= '<time class="updated" datetime="%3$s" itemprop="dateModified">%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() )
	);
	
	// If our date is enabled, show it
	printf( '<span class="posted-on">%1$s</span>',
		sprintf( '<a href="%1$s" rel="bookmark">%2$s</a>',
			esc_url( get_permalink() ),
			$time_string
		)
	);
}

hi tom,

just pasted your code as it is and its showing nothing... on blog archive and single blog. task kompleted (if that is was your code exactly intended). thanks!

but i have one post on elementor-buildt page within a wp-show-posts widget - and here the time is still showing as tooltip.
strange or as it is supposed to be???

WP Show Posts has different filters.

They're available in the current beta version if you'd like. If so, shoot me an email: https://wpshowposts.com/contact/

hmmm ...

any timeline for next WPSP official release? if not too far i might wait.

It's a tough update. Things were basically re-written so the old free plugin won't work with the new premium and the other way around. Need to figure out a way to maintain compatibility as much as possible.

This archived topic is closed to new replies.