Support » Plugin: Age Gate » Prevent theme JS from loading at age gate

  • jjds


    thanks for this plugin, it works great and is well documented. Nice work.

    My theme loads some JS that obviously throws some console errors when several elements on the page are missing, which is the case on the age gate page (i.e. navigation). What condition can I use to prevent the JS from enqueueing at the age gate? I’m looking for something like
    if (!is_age_gate) { wp_enqueue_script … }
    if (!basename($template) !== ‘age_gate.php’) { wp_enqueue_script … }

    Thanks & Regards!

Viewing 1 replies (of 1 total)
  • Plugin Author Phil


    Hi @jjds,

    Short answer – not at present, but;

    If you want to use this version I’ve added one in. You can use:

    if (age_gate_status()) {
        // your stuff

    I’ll roll it out into an official release in due course


Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.