WordPress.org

Ready to get started?Download WordPress

Forums

Change <title> depending on Category (3 posts)

  1. bmaples
    Member
    Posted 8 years ago #

    I am trying to integrate a blog with a database such that in a particular set of categories, information is pulled from a separate database based on the post title.

    Everything works fine, except it would be *much* cleaner if I could have the template pages take on different behaviors for certain categories.

    The category-x.php doesn't really seem to offer what I'm looking for.

    In general, everything is OK, except for the <title> and other meta tags from the header.

    How can I make these tags take on different sets of attributes for different categories?

    Thanks!

  2. bmaples
    Member
    Posted 8 years ago #

    To be clearer, I'm trying to figure out how in php/Wordpress to do something like the following in the header:

    If category=1 then <title>ABC</title>

    else

    <title>XYZ</title>

  3. ryoken
    Member
    Posted 8 years ago #

    i think category-x.php is what you are looking for. but as a side thing you'll also need a header-1.php which has a different title. include header-1 in category-1 and the normal header for the rest.

Topic Closed

This topic has been closed to new replies.

About this Topic