I’ve gone so far down this rabbit hole that I’m starting to confuse myself, so I thought I’d just cut my losses and come here for help.
So I have my blog posts listed on my homepage, which uses the blog template. In that template, I hide the h1 title, as it’s not needed on there. However, if I then click on a tag from a post, the title is also hidden on that page too, as the filter by tag page is also using the blog template.
So what I’d like to do is add an if statement in blog.php that logically says if this is the homepage hide the h1, but if it’s a tag page show the title as “Posts tagged: [tag]”
I’ve got this far (repurposed from Starterkit)but it doesn’t work - the h1 is just hidden on both the homepage and the tag page.
Maybe provide some info how you define $tag in this context, because without that information it’s not possible to say why your if statement doesn’t work.