0

I have 3 categories in my Wordpress site and I've linked them to 3 specific pages so the URL is site.com/tag/candles, etc.

My issue is that I'd like to add a banner specific to each category, so on the Candles category page I want a banner at the top related to candles, and then the same for the other two categories.

Is there a way I can add a category specific banner at the top of each page? I know that I can go to Posts->categories and edit descriptions and other items but I'm referring to custom html or a banner image for each one. I was planning on using an if statement to check for the three category names and display the appropriate image

I can go to Theme File Editor where I have a categories.php file, but I'm just not sure where I would need to place my PHP/HTML

6
  • 1
    Sounds like you're on the right track. Where to put this though will be dependent on the theme. There may be hooks available that you could use or you that banner may go in the header.php or perhaps a few other places. Have you tried anywhere?
    – rudtek
    Feb 24 at 17:37
  • Yes I tried in the categories.php file but it's not showing, so I'm starting to investigate some of the functions in there (it's the SmartMag theme)
    – Geoff_S
    Feb 24 at 17:49
  • 1
    use Query Monitor. it will tell you which template you need to edit.
    – rudtek
    Feb 24 at 18:22
  • Awesome, thanks!
    – Geoff_S
    Feb 24 at 19:33
  • @rudtek OK that helped me find the file, but now I have a question....I want this to be editable so should I create a widget area with my if statements and then create the 4 widgets like normal?
    – Geoff_S
    Feb 24 at 22:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.