• Resolved mommaroodle

    (@mommaroodle)


    Hi

    When using the smart conditional logic and it is set to show if page url is – do we use the whole page url g meaning including the https://domain.com/slug or is it just the page slug and if it’s just the page slug do we add the forward slash before and after – eg. /slug/

    What exactly does it do? lets say we created a shortcode from some HTML. – that is one shortcode Then created another snippet with html,css and js – the second shortcode. Both shortcodes appear on the same page.

    Does the conditional logic then only load the content the URL specified?

    • This topic was modified 1 year, 3 months ago by mommaroodle.
Viewing 1 replies (of 1 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @mommaroodle,

    We recommend using the slug part with the “Contains” operator as that has the best results. The check will work with the full URL also but that is more strict and it might not always work as expected.

    The way the conditional logic for Page URL works is that it will check if the current page URL where the snippet is loaded matches the rule you set up.
    If you are using the snippet as a shortcode, there’s no need to use the page URL conditional logic as in most cases you will insert the shortcode on a specific page.

    You may also find useful this article on limiting where a snippet is loaded with some examples from WPCode: https://wpcode.com/how-to-add-scripts-to-specific-pages-in-wordpress/

Viewing 1 replies (of 1 total)

The topic ‘Smart Conditional Logic’ is closed to new replies.