By default when on categories page Adverts rewrites the WP Query in a way that on category pages it displays the same list as on a page with [adverts_list] shortcode but filtered by category (this is what most users expect).
In order to disable this behavior you can add following code in your theme functions.php file
add_filter("init", "my_init", 20);
function my_init() {
remove_filter('template_include', 'adverts_template_include');
}
Now you should be able to create in your theme directory, file called taxonomy-advert_category.php which will be used when browsing ads by category.
Hi Greg,
That worked! However I have encountered another issue, though I don’t know if it’s tied to it. The widget when in a specific category is not showing the categories. It works in post mode however. Not sure if it’s because adverts_path on line 152 is different on class-widget-categories.php when being referenced from a category.
See site,http://neusars.org/advert-category/outfits/, to better understand what I am referring to. Also would you like me post this on a new thread?
This is how this widget is designed i am afraid. For example if you had categories like this:
- Bearings
- Boots
- Equipment
- Outfits
--- Pants
--- Shoes
- Plates
- Skates
- Wheels
Then when on this page http://neusars.org/advert-category/outfits/, widget would display “Pants” and “Shoes” categories.
Now i understand that if you have one level categories this is less than ideal, in future update i will consider adding an option to the widget so it will display top categories only.
Got it, thank you so much for all your help!
How do I add a sidebar for the ad detail page?
I have added sidebars to the listing, manage and add ads. But when I click on an ad, to view it, there is no way back to the main “adverts” page..
I’d like to add an automatic sidebar… can I add something in the functions that will place a sidebar on those ad detail pages?
I don’t want to set a “global” sidebar – because then all posts will have that sidebar. I want a specific sidebar automatically on the detail pages.
Thanks!