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

    Hi

    I wish to change Blog – Latest News to ‘Recipes’ on all posts. I’ve tried implementing this snippet, it doesnt seem to work

    Also need to change link so it goes to recipes page rather than home page

    Can you advise please

    Kind regards

    Duncan

    #1467926

    sorry meant to include link see below

    #1467939

    Hi,
    When I test this snippet on my test site it seems to work correctly:

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

    Please include an admin login in the Private Content area so we can examine.

    Best regards,
    Mike

    #1467943

    Hi Mike

    I still see Latest News even though I’ve added recipies to snippet… see link

    #1467955
    This reply has been marked as private.
    #1467959

    Hi,
    Unfortunately I’m not able to login, I get an error that the user name is not valid.
    You misunderstand the function, where you edited it looks for Blog – Latest News and then changes it to the title of the post.
    The title of your post is Portuguese Pork and Garlic – Rick Rodgers, not recipies so recipies will not show.
    To show recipies try this instead:

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

    Best regards,
    Mike

    #1467964

    Many thanks Mike

    thats a perfect fix :)

    #1467965

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Change Blog – Latest News Title’ is closed to new replies.