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

    On a French-language website, where I have deliberately chosen not to have a specific page for the blog, when I open a single article, in the “main-title entry-title” reads: Blog – A la une

    How can I change main-title entry-title ?
    For example, if I wanted “À la une” instead of “Blog – A la une”?

    (See attach image on Private Content)

    Best regards,
    Oriano

    #1486319

    Hey Oriano,
    Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    add_filter('avf_title_args', 'remove_blog_prefix_from_title', 10, 2);
    function remove_blog_prefix_from_title($title, $id = null) {
        if (is_single() && strpos($title['title'], 'Blog -') === 0) {
            // Remove "Blog -" prefix
            $title['title'] = trim(str_replace('Blog -', '', $title['title']));
        }
        return $title;
    }

    If you are not using a child theme you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
    use wpcode php snippet and activate
    and ensure that it is activated, then add the above code and save.

    Best regards,
    Mike

    #1486320

    Hi Mike,
    thanks for your snippet. It work fine to hide the text “Blog -“.

    And if I want to customise the entire title?
    Would that be possible?

    Best regards,
    Oriano

    #1486329

    Hi,
    Then use this instead:

    add_filter('avf_title_args', 'replace_blog_title_with_custom_text', 10, 2);
    function replace_blog_title_with_custom_text($title, $id = null) {
        if (is_single()) {
            $title['title'] = 'Your Custom Title Here'; // Replace with your desired title
        }
        return $title;
    }

    Change ‘Your Custom Title Here’ in the code to suit.

    Best regards,
    Mike

    #1486346

    Hi Mike, thank you very much for your help.

    Best regards,
    Oriano

    #1486347

    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 6 posts - 1 through 6 (of 6 total)
  • The topic ‘How change “Blog – A la une”’ is closed to new replies.