Can’t get conditional logic to work
-
Hi there,
First off, thanks for this excellent code snippet plug-in. I am currently migrating a bunch of snippets from Code Snippets, and also from Woody Code Snippets.
The only issue I am facing is I seem to be unable to get the conditional logic to work. Every attempt I’ve made, simply results in the snippets not loading at all, even when I believe the conditions are met.
I had a look in your documentation, to see if I was misunderstanding the logic of your options. But there’s very little explanation in there. So I figured I’d ask.
For example:
1. I have a snippet I only want to run on
wp-login.php
page. If I set uppage URL
+includes
+wp-login.php
this prevents it from running. Which seems to be the opposite of what I was expecting. This screenshot shows the setting:2. I also tried to add a snippet that runs on all pages EXCEPT those that are part of the checkout. Again, adding the relevant settings just seems to stop it from working entirely. Here’s the settings I used for that:
3. I tried to set up a snippet the ONLY runs on the checkout pages. Adding the conditional, as shown below, stops it from loading entirely:
With this last example, I can at least think of one reason it might not work on our site. We use a FunnelKit plugin, which sets up its own checkout. The URL remains the same (
/checkout/
) but it is a custom checkout. I should add, however, that the same conditional settings on Woody Snippets does not have this issue. Settings as shown here:Obviously the conditional functionality can’t be totally broken in the plugin itself, otherwise I wouldn’t be the only one I see bringing this up.
So would you please let me know what it is I am completely misunderstanding with the conditional logic?
Thanks.
Jonathan
- The topic ‘Can’t get conditional logic to work’ is closed to new replies.