• Resolved lowthian

    (@lowthian)


    Greetings. Great plugin, very happy I purchased, looking forward to upcoming releases as I’ve heard of some great new features.

    I am working with a script that I need to run only on the homepage. I have found the code for a function code to only run on single pages, but is there a way to load a javascript code only on a single page?
    Thanks.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • This would be really helpful – same with CSS – to just add it to a single page. Surprised this isn’t an option. Did you find an answer to this?

    Thread Starter lowthian

    (@lowthian)

    Not so far, I know the folks at code snippets are very busy right now, but I’m hoping one of them will jump on here and let me know if it’s going to be a feature, and if there’s some sort of method I can use for this purpose.

    Plugin Author Shea Bunge

    (@bungeshea)

    This is definitely planned for a future release. For the meantime, you can always write your CSS/JS code from within a PHP snippet and use conditional tags to determine when and where it is included on the page.

    Thread Starter lowthian

    (@lowthian)

    Thanks Shea,

    Your link shows the php for including something, but this is a script. So I see a couple of ways to do it, either put the script right into a php snippet, or, write a php snippet that calls the script snippet. What do you recommend is the easiest way to accomplish this.

    Excited about your upcoming releases!

    • This reply was modified 1 year, 7 months ago by lowthian.
    Plugin Author Shea Bunge

    (@bungeshea)

    Both are viable options – it’s really just down to the sort of code you want to include.

    Thread Starter lowthian

    (@lowthian)

    Hi Shea, thanks for your update.
    I guess what would be really nice to see in a future release is something similar to what Elementor has for custom code where you can decide where you want it to run. If that is not doable, then how about a way to enter the post id(s) on the snippets?

    Thanks,
    Geoffrey

    Plugin Author Shea Bunge

    (@bungeshea)

    We’re definitely planning on adding a conditional code feature in the near future.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Javascript only on one page’ is closed to new replies.