Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #341632

    Hi –
    GOAL: Replace the default “Blog – Latest News” title

    I’ve followed the instructions given in documentation:
    http://kriesi.at/documentation/enfold/replace-the-default-blog-latest-news-title/

    The result on my site is revealing the code given in the documentation. What is going wrong?

    #342591

    Hi Julie!

    You are missing the PHP opening tag <?php, functions.php should look like this:

    <?php
    add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
    function fix_single_post_title($args,$id)
    {
        if ( $args['title'] == 'Blog - Latest News' )
        {
            $args['title'] = get_the_title($id);
            $args['link'] = get_permalink($id);
            $args['heading'] = 'h1';
        }
    
        return $args;
    }

    Cheers!
    Josue

    #342751

    Hi Josue,
    Thanks for the code. However, it didn’t replace the “Blog – Latest News” header with the post title. Instead, it now says “Blogs” on each post. See example: http://wels.staging.wpengine.com/wels-night-brewers/ (hosted on WPengine) where instead I expected “WELS Night at the Brewers”. I must be missing something. Oh, and thanks for pointing out the opening php code (and closing code I figured out as well).
    Thoughts on the “Blogs” title appearing rather than the post title?
    j

    #342805

    Hi,

    Can you please create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #342838
    This reply has been marked as private.
    #342883

    Sure, can you please enable file editing or provide a temporary FTP account so i can edit the child theme functions.php file?

    Cheers!
    Josue

    #342937
    This reply has been marked as private.
    #342969

    Please re-check, i’m getting this error – http://screencast.com/t/cV484Vz5

    Regards,
    Josue

    #343017
    This reply has been marked as private.
    #343048

    Hey!

    Check it now, i changed the code to this:

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

    Best regards,
    Josue

    #343100

    Awesome! The code… worked as shown below. (Opening and closing PHP code assumed.) CLOSE TICKET and BIG thanks!

    add_filter(‘avf_title_args’, ‘fix_single_post_title’, 10, 2);
    function fix_single_post_title($args,$id)
    {
    if ( is_singular(‘post’) )
    {
    $args[‘title’] = get_the_title($id);
    $args[‘link’] = get_permalink($id);
    $args[‘heading’] = ‘h1’;
    }

    return $args;
    }

    #343143

    You are welcome, glad to help :)

    Regards,
    Josue

    #417943

    Please close this ticket. Thank you!

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Latest Blogs – Function.php Code Displaying the FIX’ is closed to new replies.