• Resolved mtjarrett

    (@mtjarrett)


    I just updated one of my sites. Now the title info in the browser tabs is gone. It just gives the site url.

    I’ve been reading how this is a big to do. That’s fine, I don’t care. Do what you want… but I have 7 websites, 5 of which use the same child theme. How am I supposed to fix this?

    How do I get back what was working great yesterday.

    Please help.

    Thanks.

Viewing 10 replies - 16 through 25 (of 25 total)
  • Thread Starter mtjarrett

    (@mtjarrett)

    treesourcetexas.com

    Thread Starter mtjarrett

    (@mtjarrett)

    esmi, thanks for your help. i have to go to work. i’ll leave the site in the jacked-up way until i can check back in here. thanks again,

    The title tag, however, is back. The reason that site looks bad is because you are not correctly importing the parent’s CSS.

    Now, edit your child’s style,css file and add

    @import url(../hemingway/style.css);

    Immediately after the comment block at the top.

    Thread Starter mtjarrett

    (@mtjarrett)

    Thanks again.

    I’m not seeing the title tag though. In Chrome it still shows “treesourcetexas.com” up in the tab instead of “Tree Source of Texas | Specializing in Mountain Laurels” (which is what it used to show before I updated WP)

    I’ll try the @import thing you suggested but the reason I used what I used was because of this:
    https://codex.wordpress.org/Child_Themes

    That’s where I copied the code that I put in my functions.php file.

    What esmi posted above is completely correct, but you probably did not replace ‘parent-style’ with your parent theme name (…which I am guessing is ‘hemingway’) and for ‘child-style’, it would be your child theme name (…which I am guessing is ‘hemingway-kid’).

    Therefore, in your child theme’s Functions file (functions.php), it should look like this (…if the above names are correct):

    function hemingwaykid_enqueue_styles() {
    
        $parent_style = 'hemingway';
    
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'hemingway-kid',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style )
        );
    	}
    	add_action( 'wp_enqueue_scripts', 'hemingwaykid_enqueue_styles' );

    This is from the Codex here – https://codex.wordpress.org/Child_Themes#Using_functions.php – just above the section titled “Template Files”.

    After this is done, and your site is working correctly, being as you have a Child Theme (hemingway-kid), you can solve the title problem.

    Do not touch your parent theme!! …this is only for your Child Theme!!

    1 – In your child theme’s header (header.php), remove “<title><?php wp_title(‘|’, true, ‘right’); ?></title>”. Update file. (blue button)

    2 – in your child theme’s Functions file (functions.php), insert the following one line below the “<?php” at the top of the file:

    function hemingwaykid_theme_setup() {
    	add_theme_support( 'title-tag' );
    	}
    	add_action( 'after_setup_theme', 'hemingwaykid_theme_setup' );

    Update file. (blue button)

    Your site`s title should show in the tabs of any browser.

    I`ve done this on both my main site and my subdomain site, both of which use child themes, and it works perfectly.

    Thread Starter mtjarrett

    (@mtjarrett)

    Thank you Neo (thanks to you both). That did it.

    A follow-up question though (if I need to make it a separate thread let me know) –

    I have selected to use a static page for my home page. The old way of wp_title() used to format the title of the home page like so:

    Site Title | Site Tagline

    I understand that for SEO purposes having the Page Title first before the Site Title may be better, but is there a way for the Home Page still to show the Site Title first?

    Just checked my test site and the Page Title does appear before the Site Title automatically. But if you are using a Home Page, then only the Site Title should display. I believe the functionality of this is built into WordPress.

    Edit: nope… I believe I`m wrong. I st a page as my home page on my test site and the page title still shows before the site title if you make a page the home page.

    @mtjarrett:

    Looking at treesourcetexas.com it seems like the document title works as expected. Is that problem still current? Are there other sites of yours that still don’t display it correctly?

    @mtjarrett: if everything is fine, then you should mark this thread as “resolved”.

    Thread Starter mtjarrett

    (@mtjarrett)

    I’ll start a new thread on the question above. Thanks y’all.

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘wp_title ?? what happened? i'm not a techie.’ is closed to new replies.