Theme override for categories and tags

4.00K viewsIssues

Hey, looking at base.php it says in there that this file is used for categories and tags too. But, right now, if I add anything custom to base.php it only shows up on the homepage. It doesn’t show up on other pages. Am I missing something?


Yes base.php is used for showing question list in tags and categories. Are you trying to override question list or category and tag?

I’m simply adding custom heading and search at the top of base.php, it shows up on main page but not category/tag pages. They remain default.


For that you can use ap-top sidebar position

The problem with that is you lose granular ability to add different content to base, category, tag pages. And placing a widget in that sidebar position causes widget to show up also on question page, where I don’t need it.

Use plugins like Widget Logic to condition where widgets are shown. For example to hide widget on question page, write there !is_question()

Thanks Dima. I found bunch of good functions going through Anspress files, and figured out an easy way to do it without extra plugins… don’t want to bloat site with extra plugins.

Glad to hear that, Viktor. Do you mind sharing your findings? I don’t need them right now, but they might help somebody sometime.

I used anspress functions (is_question, is_user, to add body class specific to anspress pages, then used display:none to hide what I wanted. I’ll post this as another question, since I can’t answer my own question.