Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1156051
    catecomm
    Participant

    I have a site name, but no tagline. It seems on the home page it’ll say “Site Name | ” instead of just saying “Site Name” in the title bar. I’m using Renew. How do I go about making it not have the “|” character when the tagline is blank?

    #1156237
    Friech
    Moderator

    Hi There,

    Thanks for writing in! Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Then add the code below on your child theme’s functions.php file.

    
    if ( ! function_exists( 'x_wp_title' ) ) :
      function x_wp_title( $title ) {
    
        if ( is_front_page() ) {
          return get_bloginfo( 'name' );
        } elseif ( is_feed() ) {
          return ' RSS Feed';
        } else {
          return trim( $title ); 
        }
    
      }
      add_filter( 'wp_title', 'x_wp_title' );
    endif;

    Hope it helps, Cheers!

    #1156369
    catecomm
    Participant

    I added the code to the child theme, but after refreshing the page a few times, it still has the | character 🙁

    Title showing: “Florida AAML |”
    Should be: “Florida AAML”

    #1156381
    Rue Nel
    Moderator

    Hello There,

    Thanks for the updates! Are you using Yoast SEO plugin or any SEO plugin? For the meantime, please try to update the code and use this instead:

    if ( ! function_exists( 'x_wp_title' ) ) :
      function x_wp_title( $title ) {
    
        if ( is_front_page() ) {
          return get_bloginfo( 'name' );
        } elseif ( is_feed() ) {
          return ' RSS Feed';
        } else {
          return trim( $title ); 
        }
    
      }
      add_filter( 'wp_title', 'x_wp_title', 60 );
    endif;

    To assist you better with this issue, would you mind providing us the url of your site with login credentials, if necessary, so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    To do this, you can make a post with the following info:
    – Link to your site

    – WordPress Admin username / password (only if necessary)

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thank you.

    #1156384
    catecomm
    Participant
    This reply has been marked as private.
    #1156395
    Rue Nel
    Moderator

    Hello There,

    Since you have All in One SEO, you no longer need the custom we gave previously. Simply go to All in One SEO > Settings and set the title for your homepage.

    Hope this helps.

    #1156396
    catecomm
    Participant

    Thank you!

    #1156397
    Rue Nel
    Moderator

    You’re welcome!
    We’re glad we were able to help you out.

  • <script> jQuery(function($){ $("#no-reply-1156051 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>