[Resolved] Can only add up to 8 images in for each loop for the conditional to work
This thread is resolved. Here is a description of the problem and solution.
Problem: I have a conditional set up that tests whether or not a repeating custom image field has any value(s). It works well up to 8 repetitions of the image field. If I have 9 or more repetitions, the conditional breaks.
Solution:
Disable the pcre.jit regex engine on the server by adding this line to your wp-config.php file:
I am using a conditional to display the second tab of images if there are images to be displayed. On this page, there are images to be displayed but the conditional is not working. You can see an example of a working page here with 2 tabs:
hidden link
It works for upto 8 images and then adding a 9th the second tab disappears.
Hello, Minesh asked me to take a look since he's in an earlier time zone. I hope that's okay. I don't see anything obvious in the template that would cause the conditional to fail after 8 images. Do you have a staging environment set up where I can turn plugins on and off and add markup to try to pin down the problem?
Yes that would be fine. In this case since the images are integral to the issue, please include the uploads directory, or at least the images required for the two posts you mentioned in the link above. Normally I would ask to strip out uploads to save space, but in this case I think you should include them if possible.
Private reply field here for posting a Duplicator download link. Thanks!
Okay it's odd because on my local installation the conditional works without any problems when I have 9 images. Is there any server-side caching system in place, like object caching, memcached, etc? Is it possible to purge any of those server-side caches?