Hi, hmm i am not sure, maybe the $loop variables are conflicting somehow? Can you let me know what changes are you making to stop the infinite loop? It will be easier to troubleshoot then.
Hi Greg, sorry for delay, I really appreciate your support.
The problem is in list.php and precisely in this line of code
apply_filters( "adverts_template_load", ADVERTS_PATH . 'templates/list-item.php' );
Commenting this line obviously I get no resulta, but the rest of the page is ok and is not broken for an infinite loop.
You can see it in action here:
P.S. If it helps, I noticed that in categories with no ads everything works properly.
Hi, thanks for the update, i am wondering if you add at the beginning of list.php following line
remove_all_filters( 'adverts_template_load' );
would this help?
This is a good point. Removing filters that page works, but it ignores custom templates placed into theme_folder/wpadverts, which is something I need to keep.
For some reason, listing loop works only on main page listing, but not in single category listing (unless category is empty).
Hmm, does any of your custom templates use apply_filters( "adverts_template_load", "..." ) call? If so then this will cause an infinite loop, the child templates should never use this filter.
Ok, so, this is what happens:
– Override Templates plugin installed
– custom templates loaded in child theme (/wpadverts)
– classifieds main page loads custom templates if
remove_all_filters( 'adverts_template_load' );
is removed from list.php
– taxonomy page (advert-category taxonomy) breaks (loops). But it works if on top of list.php I place:
if(is_tax()) {
remove_all_filters( 'adverts_template_load' );
}
The problem is that deactivating filters prevents from loading custom code in taxonomy page.
I’m in a logic loop 😀