Help with itemprop=”datePublished”
-
Hi
I want to change the post datePublished to my custom date.
Can you help me with this?
Getting the date is working fine, i’m using it somewhere else but maybe the filter is wrong?
<code> add_filter( 'og_article_published_time_meta', 'my_article_published_time_meta' ); function my_article_published_time_meta($datePublished) { if (in_category(array(344, 346))) { $event_date = get_field("event_data"); $event_date_date = date('Y-m-d', strtotime($event_date)); $datePublished = '<meta itemprop="datePublished" content="'. $event_date_date .'" />'; return $datePublished; } return $datePublished; } }</code>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Help with itemprop=”datePublished”’ is closed to new replies.