Ready to get started?Download WordPress


Change Blog Title in Post pages to Category name (4 posts)

  1. denutza
    Posted 2 years ago #

    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:

    <?php wp_title(''); ?>
    <?php if(wp_title('', false)) { echo ' :'; } ?>
    <?php bloginfo('name'); ?>
  2. Marco Milesi
    Posted 2 years ago #

    Try this:

    <?php if ( is_single() ) {
       <title><?php bloginfo('name'); ?></title>
    else {
       <title><?php the_category() ?></title>
    } ?>
  3. IshaanRawat
    Posted 2 years ago #

    Do you want like this :::
    YourBlogTitle = CategoryName

  4. denutza
    Posted 2 years ago #

    yes, YourBlogTitle = CategoryName .

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

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.