How to replace blog title with post title in wordpress

by zebrex
12 replies
Please i need some help here. i have tried changing the blog title of my blog to always show the post titlefor each post instead.(i.e for each recent post, the blog title/site title would show the post title which is good for SEO).

Can anybody please help me out.
#blog #post #replace #title #wordpress
  • Profile picture of the author rahulbatra
    I think you are saying every time when you post into blog your blog tittle changes to your post tittle. If I am correct there is no such feature like this but you might search for such plugins.
    {{ DiscussionBoard.errors[2694380].message }}
    • Profile picture of the author zebrex
      there is actually. i have seen some websites that do that. dont know if it is a plugin or perhaps the title tag needs rearranging. An example is this website reviewbonus4u dot com.

      can anyone please look at this website and give a solution
      {{ DiscussionBoard.errors[2694512].message }}
  • Profile picture of the author Evan-M
    try this

    edit your header file, and put this code in the title tag:
    <?php the_title(); ?>

    if i read what your wanting correctly that should do it.
    Signature

    Evan-M

    Easily The Worlds Best Wordpress Popup plugin

    Visit Website Design Firm For All Your Wordpress Coding Needs

    {{ DiscussionBoard.errors[2694522].message }}
    • Profile picture of the author zebrex
      thanks evan what code between the title tag should i delete and replace with the code you just gave
      {{ DiscussionBoard.errors[2694560].message }}
      • Profile picture of the author Evan-M
        Originally Posted by zebrex View Post

        thanks evan what code between the title tag should i delete and replace with the code you just gave

        does your title look like this now ???

        <?php if ( is_home() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php bloginfo('description'); ?><?php } ?>

        <?php if ( is_search() ) { ?><?php _e('Search Results','cp'); ?>&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>

        <?php if ( is_author() ) { ?><?php _e('Author Posts','cp'); ?>&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>

        <?php if ( is_single() ) { ?><?php wp_title(''); ?>&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>

        <?php if ( is_page() ) { ?><?php wp_title(''); ?>&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>

        <?php if ( is_category() ) { ?><?php single_cat_title(); ?>&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>

        <?php if ( is_month() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php the_time('F'); ?><?php } ?>

        <?php if (function_exists('is_tag')) { if ( is_tag() ) { ?><?php single_tag_title("", true); } } ?>
        Signature

        Evan-M

        Easily The Worlds Best Wordpress Popup plugin

        Visit Website Design Firm For All Your Wordpress Coding Needs

        {{ DiscussionBoard.errors[2695145].message }}
  • Profile picture of the author pjCheviot
    Banned
    Originally Posted by zebrex View Post

    Please i need some help here. i have tried changing the blog title of my blog to always show the post titlefor each post instead.(i.e for each recent post, the blog title/site title would show the post title which is good for SEO).

    Can anybody please help me out.
    Try either of these plugins

    WordPress › Platinum SEO Pack « WordPress Plugins

    WordPress › All in One SEO Pack « WordPress Plugins
    {{ DiscussionBoard.errors[2696398].message }}
  • Profile picture of the author kirrugadu
    well i have the same doubt since i have the same problem with my WP...
    {{ DiscussionBoard.errors[2696791].message }}
  • Here is how to display the post/page name in the title tag:

    1. Edit your Wordpress theme's header.php file with the following code:

    Code:
    <title><?php if(wp_title('', false)){wp_title('');}else{ bloginfo('name');}?></title>
    2. Add this code to your functions.php file:

    Code:
    <?php
    
    function removeTitleSpace($title) {
        return trim($title);
    }
    
    add_filter('wp_title', 'removeTitleSpace');
    
    ?>
    Hope this helps!
    {{ DiscussionBoard.errors[2697394].message }}
  • Profile picture of the author zebrex
    thanks guyz.chris iv tried your option but it didnt work perhaps i placed the code in the wrong place. could you advice where to put the code.

    Evans this is how my title looks at the moment,

    <title>
    <?php wp_title(''); ?>
    <?php if(wp_title('', false)) { echo ' :'; } ?>
    <?php bloginfo('name'); ?>
    </title>

    This is an example of what i hope to achieve with your help {reviewbonus4u dot com/reviews/forward-to-marketing/forward-to-marketing-review-bonus}
    {{ DiscussionBoard.errors[2700015].message }}

Trending Topics