Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #220757

    I have been looking for this function in various files but can’t seem to find it. Where is the avia_set_title_tag(); function located?
    At the moment my titles look like this “Website Name | Main Page”. I would like to change it slightly to not use pipes “|” but a dash “-“. Also at the moment the spacing after the pipe “|” is triple spaced but I want to make it single space.

    Thank you in advance.

    #220763

    Hey Serge!

    You can add this to your functions.php file to filter the title as needed:

    add_filter('avf_title_tag', 'avia_change_title_tag', 10, 2);
    function avia_change_title_tag($title, $wptitle) {
    	    
    
    	    $title = get_bloginfo('name').' | ';
            $title .= (is_front_page()) ? get_bloginfo('description') : wp_title('', false);
    
            return $title;
    }

    Cheers!
    Devin

    #220769

    Thank you so much Devin, I got it working. Now I have a double space instead of triple space after the pipe “|”.
    I changed $title = get_bloginfo('name').' | '; to $title = get_bloginfo('name').' |'; to get rid of one of the spaces after the pipe “|”.
    But I think the ‘description’ is adding the unwanted double space. How would I go about removing these spaces?

    #220778

    Hi!

    I tested locally and it worked (having only one space around the pipe), can you post a link to your website?

    Regards,
    Josue

    #220797

    I’m using XAMPP test server so I am not able to send you a link.
    I found another thread in the forum that suggested to use the “Yoast WordPress SEO” plugin and that did the trick.

    Thanks guys.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Where is the avia_set_title_tag(); function located?’ is closed to new replies.