Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Aidas

    (@frankenstein-uk)

    Hello,

    why don’t you just include the shortcode where you need the form?

    for e.g. you create a form, and then can include shortocde either into page content, or into you theme files, and wrap with your if statment

    If it needs to be only on single page, I would suggest creating a page template for that page, and then include shorcode only into that template.

    Or you can wrap shorcode with if statment. But this needs to be done in your theme, rather editing the plugin itself.

    Cause plugin allows multiple forms, and what you did, you restricted all forms to one page.

    if(your_statment){
        echo do_shortcode('[nm_forms id="contact_me"]');
    }

    Hope that helps,
    If you still need help, feel free to contact me on https://nutmedia.co.uk

    Thanks,
    Aidas

    Thread Starter LouDB

    (@loudb)

    Thank you so much for your prompt answer!

    You’re right, I hadn’t thought about the possibility of having multiple forms in the future ??

    I realize my first message wasn’t clear: the plugin loads front.css and recaptcha.js on every page of the website even if there is no contact form on it.

    I tried your solution but it still loads front.css/recaptcha everywhere. It’s like:
    – No form at all => no front.css/recaptcha.js
    – One form or more => loading of front.css/recaptcha.js on the whole website even if the form itself is just on one page.

    I’m too much of a beginner in php to solve the mystery on my own ??

    Plugin Author Aidas

    (@frankenstein-uk)

    I see, now I get your question.
    Really that shouldn’t cause any trouble. As them files won’t be used anyways.

    Although I will see what I can do about it in next plugin update.

    Thanks,
    Aidas

    Plugin Author Aidas

    (@frankenstein-uk)

    Hello LouDB,

    Please update to version 1.1.3, this version loads front end resources to page only when shortcode is used.

    Thanks,
    Aidas

    Thread Starter LouDB

    (@loudb)

    Brilliant! Brilliant! Brilliant! You rock ??

    Thank you and keep up the good work!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Loading the plugin only on a specific page?’ is closed to new replies.