Support » Fixing WordPress » Change Blog Title in Post pages to Category name

  • denutza

    (@denutza)


    I would like a different Blog Title for every individual post page, where blog title= current Category name.

    I know I have to edit header.php between <title> </title> but am new at this. For anything other than individual post pages, I want default title.

    Current code is:

    <title>
    <?php wp_title(''); ?>
    <?php if(wp_title('', false)) { echo ' :'; } ?>
    <?php bloginfo('name'); ?>
    </title>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Try this:

    <?php if ( is_single() ) {
       <title><?php bloginfo('name'); ?></title>
    }
    else {
       <title><?php the_category() ?></title>
    } ?>

    IshaanRawat

    (@ishaanrawat)

    Do you want like this :::
    YourBlogTitle = CategoryName

    denutza

    (@denutza)

    yes, YourBlogTitle = CategoryName .

    But only when reading individual post that is assigned a category.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change Blog Title in Post pages to Category name’ is closed to new replies.