My blog page is not my homepage. How can I add a title to the top of the page? i.e. “My Blog”. Right now there is no title on the page. The title of the first post is at the top. (Sorry it’s on my local machine or I’d provide a link and I’m too new to post an image.)
Things I’ve tried:
- Creating a “blog” template page. It didn’t work because the blog
always uses index.php. (Thanks to Rev. Voodoo for the code that
helps you see which template is used.) - There is a similar question on stackexchange but it’s not really
answered and I don’t understand it.
Thank you!
the accepted answer in the similar question on stackexchange should work;
try to add this to a suitable location in index.php of your theme:
I discovered
<?php single_post_title(); ?>
that works for both blog title and for other pages without any modifications. 🙂So you can use it on the top of the page, and also in the page.