Title: Smart Conditional Logic
Last modified: February 20, 2025

---

# Smart Conditional Logic

 *  Resolved [mommaroodle](https://wordpress.org/support/users/mommaroodle/)
 * (@mommaroodle)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/smart-conditional-logic/)
 * 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](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](https://wordpress.org/support/users/mommaroodle/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/smart-conditional-logic/#post-18317697)
 * Hi [@mommaroodle](https://wordpress.org/support/users/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/](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.

 * ![](https://ps.w.org/insert-headers-and-footers/assets/icon-256x256.png?rev=2758516)
 * [WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager](https://wordpress.org/plugins/insert-headers-and-footers/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-headers-and-footers/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-headers-and-footers/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-headers-and-footers/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/smart-conditional-logic/#post-18317697)
 * Status: resolved