• I know this is covered in a lot of places but I’m not finding something that actually works for my case.

    I’m using Twentyten, I would like to simply remove the title and description from displaying.

    It seems the title info is called from the header.php file, and in that file it looks like this:

    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 */
    	global $page, $paged;
    
    	wp_title( '|', true, 'right' );
    
    	// Add the blog name.
    	bloginfo( 'name' );
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 )
    		echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
    
    	?></title>

    I also have a child theme if it that would be better.

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Copy header.php from TwentyTen into your child theme and change it there ??

    I would like to simply remove the title and description from displaying.

    Use this:

    <title><?php wp_title(); ?></title>

    Thread Starter Chris

    (@forumusr)

    Nothing happened.

    I duplicated the header.php file and replaced everything between the <title>s with the above.

    Copied that into the child directory.

    Do I have to tell “it” to use the child theme header.php instead of the parent?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You have to tell WordPress to use the Child Theme in general. ?? Did you do that?

    Thread Starter Chris

    (@forumusr)

    I did do that. The child theme is in use for style.css, functions and category.

    But in the header file itself, it’s just the above code; does it need some kind of opening code or something or something (I don’t think this is the problem but why not ask).

    I’ll come back in the morning and work in this some more.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The way a child theme works is that IF the file is in the child folder, it’s used INSTEAD of the one in the parent folder. I replaced the header.php in my twenty eleven child theme yesterday doing just that ??

    So long as you copied the WHOLE header.php into your folder, edited it, saved it, and activated the child theme, it works fine ??

    Thread Starter Chris

    (@forumusr)

    I’ve copied the file into the child and replaced between the <title> tags with the above. It’s really not working.

    I guarantee you there is some other little setting that we’re overlooking, this *always* happens I have found with troubleshooting WP.

    I would be happy to send you a PM with my login details, the site is https://www.musiclessonshq.com

    Thanks for your help.

    Thread Starter Chris

    (@forumusr)

    I know what the problem is, but I don’t know exactly how to fix it.

    I replaced the wrong code. I replaced the <title> in the <head> tags, not the <body> tags. With all due respect, I think you missed this too.

    So, here is entire code for the header file. Where *exactly* do I replace the <title> stuff?

    [code removed]

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Removed your code. If it’s longer than 10 lines, generally you need to post on Pastebin or you make our spam checker angry. And it’s like the Hulk.

    https://pastebin.com/YfW9fALe

    Look at line 16.

    Thread Starter Chris

    (@forumusr)

    ok I didn’t know that. I learn something new here every day.

    Line 16 is where I originally put the it (which is in the head tags).

    Yeah, that doesn’t do it.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Removing title and description’ is closed to new replies.