• I’m trying to get my header code to adjust so that I can add my descriptions to my main page title tags. Would anyone know how to adjust the HTML in my header.php so that my main page has the title and description in the title tag and then for each blog post its description then the title of my blog. Thanks. My site is topcardioexercises.com

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter mjc09

    (@mjc09)

    bump

    no need to bump – it is rude and against the forum rules, and there is nobody here in a rush on a sunday morning.

    please start by posting the code of your title tag as it is now.

    and please clarify what you mean with:

    for each blog post its description

    where is that description coming from?
    is it the post title, a custom field, or what?

    something to read while you wait:
    http://codex.ww.wp.xz.cn/Template_Tags/wp_title

    Thread Starter mjc09

    (@mjc09)

    <body>
    <body>
    <div id="page_wrap">
    	<div id="header">
            <div id="headerimage">
    		<div class="blog_title">
    			<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    			<p class="description"><?php bloginfo('description'); ?></p>
    		</div> </p>
    	</div>

    sorry, okay so thats how it looks now. What I would like is (title tag bar) Top Cardio Exercises – description 1 description 2 description 3 (end of title tag) then for each blog post, it shows the title of the post first on the title tag and then 2 is Top Cardio Exercises Hope you understand thanks, and sorry again.

    I assume it’s a pasting error, but check your double body tags. You’ll also want a <title></title> tag somewhere up there. Try this:

    <body>
    <div id="page_wrap">
    	<div id="header">
            <div id="headerimage">
    		<div class="blog_title">
                            <?php if (is_single() ) { ?>
    			<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?> | <?php bloginfo('description'); ?></a></h1>
                             <?php } else { ?>
    
    <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('description'); ?> | <?php bloginfo('name'); ?></a></h1>
                        <?php } ?>
    		</div> </p>
    	</div>
    Thread Starter mjc09

    (@mjc09)

    Nah, its not doing anything, it didn’t do anything for my title tag

    Really? Your h1 tag should now say:

    “Blog Name | Blog Description” on pages AND

    “Blog Description | Blog Name” on posts

    There definitely should have been a change from what you had before. If there wasn’t it probably means you didn’t get the code into the right file or wasn’t uploaded correctly. I can help you debug if you post a link.

    Thread Starter mjc09

    (@mjc09)

    my link is topcardioexercises.com (also for some reason there is too much space from the very top to my first post.) I appreciate your help.

    Okay, find this line of code in your header.php file:

    <div id="page_wrap">
    	<div id="header">
            <div id="headerimage">
    		<div class="blog_title">
    			<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    			<p class="description"><?php bloginfo('description'); ?></p>
    		</div> </p>
    
    	</div>
    </div>

    Let’s just do a test to see if we got the right template. Replace the above code with:

    <div id="page_wrap">
    	<div id="header">
            <div id="headerimage">
    		<div class="blog_title">
    			<h1>TEST</h1>
    			<p class="description"><?php bloginfo('description'); ?></p>
    		</div> </p>
    
    	</div>
    </div>

    When you upload it, your title should now say “TEST”. If it doesn’t then either the code is not being uploaded correctly, or your template is a bit odd.

    If you the code does change, try updating it again to say this:

    <div id="page_wrap">
    	<div id="header">
            <div id="headerimage">
    		<div class="blog_title">
                            <?php if (is_single() ) { ?>
    			<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?> | <?php bloginfo('description'); ?></a></h1>
                             <?php } else { ?>
    
    <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('description'); ?> | <?php bloginfo('name'); ?></a></h1>
                        <?php } ?>
    		</div> </p>
    	</div>

    If not, see if the above code is in your index.php file or your page.php file. If so, update it there and try uploading again.

    Thread Starter mjc09

    (@mjc09)

    okay, now go to my site and look how it appears its not correct. The title and description are all on one line and the title tag has just my title

    Okay. Your blog looks the same to me. Are you referring to the <title> tag? The thing that appears in the top of your browser, or the h1 tag, what appears inside the <h1> tag of your post. Maybe we’re not communicating well here.

    What is it that’s not happening correctly?

    Thread Starter mjc09

    (@mjc09)

    I switched it back to my theme because my HTML got all screwed up and I had to retrieve it. All I was looking to do, was have my title tags only changed so it would look as follows Top Cardio Exercises – Cardio Workouts|Physical Fitness|Weight Loss

    then, for each blog post my title tag would appear as follows Running – Top Cardio Exercises

    That’s all I was looking to do. Just all changes to my title tags nothing changes on the actual page.

    Ah, gotcha. Install the All in One SEO plugin, or the LightSEO plug-in. That should be easier than messing with your templates.

    Thread Starter mjc09

    (@mjc09)

    okay I installed the all-in-one SEO plugin, but the only issue I have is that there seems to be no way for me to add my descriptions to my main page title tag any idea where or how I can add my descriptions to the main page title tag?? Thanks

    Thread Starter mjc09

    (@mjc09)

    anyone know how I can change that? Add descriptions to my main index page title tag? Thanks

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Title Tag issue’ is closed to new replies.