• Hey guys,

    How can I exclude certain pages in my website from running a code snippet? E.g. if I run an LMS, I may not want a social proof widget to come up while someone is taking a course.

    Cheers,

    D1C

Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    You can use conditional tags to check what sort of page it is, and then determine whether to run the snippet.

    For example, to exclude the current snippet from pages with the slugs hello and goodbye, you would add this to the beginning:

    if ( is_page( [ 'hello', 'goodbye' ] ) ) {
    	return;
    }
Viewing 1 replies (of 1 total)

The topic ‘Exclude certain pages from code snippets running’ is closed to new replies.