I’ve added this line of code in my function.php child file, but the date doesnt show still, any idea what need fixing? see private for example
/*
*Replace the default “Blog – Latest News” title
*http://kriesi.at/documentation/enfold/replace-the-default-blog-latest-news-title/
*https://kriesi.at/support/topic/add-posted-date-to-blog-title/#post-662175
*/
add_filter('avf_title_args', 'fix_single_post_title', 10, 2);function fix_single_post_title($args,$id){$my_date = the_date('', '<span>', '</span>', FALSE); if ( $args['title'] == 'Blog - Latest News' ) { $args['title'] = '<strong>POST FOR: </strong>'. $my_date .' - <strong>' .get_the_title($id). '</strong>'; $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args;}
Hey kilimats,
Does it work if you remove this conditional?
if ( $args['title'] == 'Blog - Latest News' ){
}
Best regards,
Josue
OK so i removed this
if ( $args['title'] == 'Blog - Latest News' )
Now the code applies to all title and it works fine for pages but not post still, see private for example, any idea?
Change this part:
the_date('', '<span>', '</span>', FALSE);
To:
get_the_date('', $id);
worked thank you !
You are welcome, glad to help :)
Regards,
Josue