Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #670436

    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;}
    
    #671875

    Hey kilimats,

    Does it work if you remove this conditional?

    if ( $args['title'] == 'Blog - Latest News' ){
    
    }

    Best regards,
    Josue

    #672138

    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?

    • This reply was modified 8 years, 3 months ago by yingyang.
    #672143

    Change this part:

    the_date('', '<span>', '</span>', FALSE);  
    

    To:

    get_the_date('', $id);  
    
    #672147

    worked thank you !

    #672151

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.