Update ACERT plugin
We would like to update our ACERT plugin (attached).
I added lines 389-403 to include events and projects on category pages.
#1 Updated by Boone Gorges about 3 years ago
- Category name set to WordPress Plugins
- Status changed from New to Resolved
- Target version set to 1.9.10
Sure thing. Updated in https://github.com/cuny-academic-commons/cac/commit/381e0b0c564593b7c43e67b01cf9cf85359b75ce
#2 Updated by David dos Santos about 3 years ago
We were wondering if anything in particular stood out to you during this update. I was able to include events and projects and category pages on our test site with this version of this plugin but it is not working on our live site.
#3 Updated by Boone Gorges about 3 years ago
Hi David - I looked over the code before merging it to the Commons and it looked OK to me. Can you give me more specific instructions on how to reproduce the problem you're experiencing on the production site (including URLs)? I may be able to do some targeted debugging.
#4 Updated by David dos Santos about 3 years ago
Hi Boone-on our test site here: http://wat1.hunter.cuny.edu/?cat=120
we have a post, and an event and project where I have extended the category to the taxonomies.
This update displays them to the category pages.
On our live site if I go to an event such as:http://acert.hunter.cuny.edu/events/calendar/wikipedia-sp16/
and click on a category(which we list under Topics) on the page such as "Assignments & exams" http://acert.hunter.cuny.edu/pedagogy/assignments/
I can see all the posts in this category but not any of the events.
Thank you so much for looking into this.
#5 Updated by Boone Gorges about 3 years ago
Hi David -
Thanks for the additional details. I'm not able to access your test site - maybe it's behind a firewall or something.
After some debugging, it looks like there is a conflict between your most recently added custom code (query_post_type()) and the Add Categories to Pages plugin. The latter plugin is forcing the 'post_type' query var on all category pages to 'post,page'. So when your query_post_type() checks to see whether $query->get( 'post_type' ) is empty, it never is - Add Categories to Pages has already set it. In cac-acert-custom.php, you're already adding the 'category' and 'post_tag' taxonomies to your post types, which means that Add Categories to Pages is superfluous. I'd suggest deactivating it, and looking to see whether the problem is solved.