WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. denutza
    Member
    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:

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

    Try this:

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

    Do you want like this :::
    YourBlogTitle = CategoryName

  4. denutza
    Member
    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

Tags

No tags yet.