Forum Replies Created
-
AuthorPosts
-
Angela
ParticipantHi Cliff,
Thanks so much for all of your help with this issue. There was a plugin installed on our website called “Category pagination fix” by “rahnas” that was the real cause of this problem. I reverted the changes I made to the template-loader.php file and deactivated the plugin I mentioned, and our categories pagination is working just fine.
Thanks again!
Angela
ParticipantHi Cliff,
I decided to go a different route with debugging and found a lot of good info.
I printed the stack trace for both http://staging.slugmag.com/comics and http://staging.slugmag.com/comics/page/2/ with TEC PRO plugin activated then deactivate. I’ve attached the printout for the /page/2/ stack trace with TEC PRO turned on. I noticed that the page.php theme template was running, and TEC came into play by hooking into the “the_content” filter.
But I still wasn’t sure why the page.php template was being called instead of category.php, so I dug deeper. The core file wp/wp-includes/template-loader.php applies the ‘template_include’ filter, which was changing category.php to page.php (with TEC PRO activated). For some reason, the function that TEC plugin hooks into that filter is mutating the template file when it shouldn’t be.
I took a look at wp/wp-content/plugins/the-events-calendar/src/Tribe/Template.php that has a function that hooks into ‘template_include’. The function runs the ‘tribe_tec_template_chooser’ action, and then checks to see if the wp_query is a tribe events query; if not, the function returns the template string. It seems like the function isn’t working as expected since it’s mutating the template string for our categories archives.
I’ve added a few lines of code to the template-loader.php file on our website so that our categories archives function as expected, but I’m obviously still hoping for a fix since the template-loader.php is a core file and upgrading our WordPress instance will re-introduce the problem if the plugin hasn’t fixed it yet.
Thanks!
Angela
ParticipantNope. With the Twenty Seventeen theme activated, all plugins deactivated (except for Events Calendar PRO), and the permalinks re-saved there’s another weird redirect happening. Now the http://staging.slugmag.com/comics/page/2 redirects completely to http://staging.slugmag.com/lifestyle/festival-coverage/page-one-a-year-inside-the-new-york-times/2/
I’ve attached the output of the Rewrite Rules Inspector after the changes above were made.
Angela
ParticipantI wasn’t able to get the video to work.
Here is the screenshot of our Permalinks setting, and the output of the Rewrite Rules Inspector for the URLs you requested. I pulled all of the screenshots from our staging site, but it is configured the same as our production site.
Angela
ParticipantSure!
If you go to http://www.slugmag.com/comics you’ll see the normal archives layout using our theme’s category.php file. However, if you scroll to the bottom and click the ‘Next Page’ button (or go to http://www.slugmag.com/comics/page/2/) then you’ll see that the category.php file template is not loaded. Instead, the Events Calendar month.php template is used. All categories on our site are affected by this. The only way to fix it right now is to deactivate the Events Calendar PRO plugin.
-
AuthorPosts
