• Some time ago I changed the header.php file with the line

    <title>Sample</title> because I wanted the home page to display the “Sample” title.

    I didnt noticed, however, that by setting the title manually all the pages, including the single posts, would display this same title.

    Is there a way to create a dynamic title where the title will match the content of each page?

    thanks

Viewing 1 replies (of 1 total)
  • Sure, you can use something like:

    <title><?php if
    (is_single()) { wp_title(”); }
    elseif (is_404()) { echo ‘404’; }
    elseif (is_category()) { echo ‘browsing ‘; single_cat_title(); echo ‘ posts’; }
    else { bloginfo(‘name’); } ?></title>

    or more extended if you like.

Viewing 1 replies (of 1 total)
  • The topic ‘How to set a variable title for each page’ is closed to new replies.