OK, I managed to display the date with a custom shortcode (below).
Now I would like to display the date inside the post link, right after the Title.
– The get_adjacent_post_rel_link function might be the key
– Or could I achieve that modifying the render of the Post Navigation Link Block ?
… Any idea ?
Thanks
add_shortcode('prevpostdate', 'prevpostdate_func');
function prevpostdate_func()
{
$in_same_cat = false;
$excluded_categories = '';
$previous = true;
$post = get_adjacent_post($in_same_cat, $excluded_categories, $previous);
$daterecup = $post->post_date;
return mysql2date("d F Y", $daterecup, true);
}
-
This reply was modified 3 years ago by
charlie67p.
-
This reply was modified 3 years ago by
charlie67p.
I finally did it with my custom shortcode
next_post_link('<div class="post-navigation-link-next">%link</div>', $TitleNextDate);
where $TitleNextDate is getting $post->post_title and $post->post_date
[ the Post Navigation Link block could be improved with a ”showDate” attribute…]
-
This reply was modified 3 years ago by
charlie67p.