Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #390876

    ref: https://kriesi.at/support/topic/latest-blogs-function-php-code-displaying-the-fix/
    GOAL: Get the blog post code you provided earlier to behave for a new content type as well.

    ISSUE:

    For line: if ( is_singular(‘post’) )

    I want to add a new custom content type named wels-devotions which is a post with added fields. So I added it this way…

    <?php
    
    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;
    }
    
    ?>

    …and also tried if ( is_singular('post,'wels-devotion') )

    When I add the content type (both of these ways) neither work. Blogs-Latest-News static text still displays for my content type but perfectly for standard posts. I’m new to content types (wp-types plugin) – is there something I need to do to get Enfold theme to recognize it?

    • This topic was modified 9 years, 3 months ago by welswebmaster. Reason: fix CODE
    #390887

    I even tried this…

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

    Hi!

    Thank you for using Enfold.

    Please try this:

    if ( is_singular(array('post', 'wels-devotion')))
    

    Best regards,
    Ismael

    #393852
    This reply has been marked as private.
    #394214

    Hi!

    Alright. Please post the login details here so that we can check it.

    Cheers!
    Ismael

    #394430
    This reply has been marked as private.
    #395578

    Hey!

    The code we provided above works as expected. Please check it here: http://welstest.wpengine.com/wels-devotion/thursday-devotion-february-5/ (hosted on WPengine)

    Regards,
    Ismael

    #395782

    Awesome. Must be user error (that would be me). For the record, when I see an email from you guys, to me – its like a gift. Thanks so much for your support, Ismael.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Add content type for Blogs-Latest-News override’ is closed to new replies.