Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #417787

    You recently helped me with great success to replace the “Blogs – Latest News” header with the title of either the blog or a custom content type (ref. https://kriesi.at/support/topic/add-content-type-for-blogs-latest-news-override/). That worked great!

    I have a new custom post type (faq), where the single post title is actually a long question. Thus, placing that as the header wouldn’t work well. Instead, I would like – if content type = faq, then use h1 static text of “Topical Q&A”, but still keep the other content types as the title. The code you’ve supplied me with was… How might I add the faq static text as well? Thanks for your help – and especially the new post types in Enfold version 3.1. Totally awesome work!

    add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
    function fix_single_post_title($args,$id)
    {
        if ( is_singular('post,wels-devotion') )
        {
            $args['title'] = get_the_title($id);
            $args['link'] = get_permalink($id);
            $args['heading'] = 'h1';
        }
    
        return $args;
    }
    #419064

    Hi Julie!

    Try with the following:

    add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
    function fix_single_post_title($args,$id)
    {
        if ( is_singular('post,wels-devotion') )
        {
            $args['title'] = get_the_title($id);
            $args['link'] = get_permalink($id);
            $args['heading'] = 'h1';
        }
    
        if( is_singular('faq') ){
        	$args['title'] = "Static FAQ Text";
        }
    
        return $args;
    }

    Regards,
    Josue

    #421308
    This reply has been marked as private.
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Enfold: Static Text for Blogs-Latest News header’ is closed to new replies.