Hi,
I’m trying to set up a simple site with a landing page whose title is the blog name and description, a blog page whose title is “Blog” and the blog name, and the other pages whose titles are the_title(), or just the titles of the page and the blog name.
So far, I have managed to achieve this with some messy php, but the Blog page does not behave right — though under the page selection, I have use “Blog” as its template, it does not change its title according to the is_page_template(‘template-blog.php’) as seen below:
http://pastebin.com/E8uc4Xr1
Instead of showing the title on the blog page as “Blog | SiteName”, it shows up as “LatestBlogPost | Site Name”, which I’d only like it to do on the individual post’s page.
So, I’ve reverted to simply using wp_title, but that includes the blog description on the blog page, which I don’t want to do.
In addition, the blog name and description do not appear on the other pages, only something like:
“Page Name” |
Where “|” is the separator.
How can I get the title to be different on the Blog page? I love this theme, but this little detail is annoying me. I can’t figure out how to detect that I’m on the main blog page, or better yet, how to modify the behavior of wp_title().
Thanks!
-
This topic was modified 12 years, 3 months ago by squashai. Reason: Code was lost; pastebin link added
Try using a plugin like WordPress SEO by Yoast to handle the title tag.