Site logo

Archived topic

generate_post_date_output not working when generated in an element

2 replies · Started by Dave on September 23, 2022

Viewing posts 1–3 of 3

Hi,

The generate_post_date_output filter does not / is not working when you generate your post_date inside an element. Should it??

i.e.

I've a local development environment with a copy of my live site and all the plugins disabled except GP.

In my child theme I have just this in my functions.php:

add_filter( 'generate_post_date_output', function( $output, $time_string ) {
    return sprintf('WHY IS THIS NOT DOING ANYTHING???');
}, 10, 2 );

My custom header elements looks like this:

<h1>
	{{post_title}}
</h1>	
	<p class="hero_meta">
		 {{post_author}} | {{post_date}} | {{post_terms.category}}
</p>

IF this is desired behaviour and not a bug, how can I customise the post_date output when I'm generating it inside a header element?

Actually, nevermind I think I figured it out from another post on here. I made a shortcode to do what {{post_date}} does so I can customize it.

Glad you sorted it out :)

This archived topic is closed to new replies.