Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #526489

    Hi,

    I am trying to add a bit of code to our home page. I have found this post https://kriesi.at/support/topic/add-javascript-to-page/, but I need a little more help please.

    I have added a javascript file to the js folder in the enfold theme and I call it in the header for a page, but I can’t seem to get WP to run the code.

    looking around the internet and the post above I need to add some code to Functions.php, but I am not sure what or where in Functions.php I need to add and I don’t want to break it.

    Can you help me?

    #526726

    Hey SFBandit,

    What code do you need to add and why? You might be able to just use the code block in the editor maybe?

    Regards,
    Rikard

    #527676

    Hi Rikard,

    Many thanks for replying. We have an older html landing site that has a javascript run slider that we really want to keep on the new site. We can’t find anything remotely similar in wordpress so would just like to integrate it to a page in the theme without doing something nasty like iframes. everything seems to be in place, but the javascript doesn’t work.

    Thanks
    James

    #528246

    Hi,

    What did you try so far? Please send us a temporary admin login so that we can have a closer look. You can post the details in the Private Content section of your reply.

    Thanks,
    Rikard

    #528773

    Many thanks for looking at this for me Rikard.

    #529055

    Hi,

    If you only want the code on one page I think the simplest option is to paste it into a code block element on the page itself, did you try that?

    Regards,
    Rikard

    #529433

    Do you mean adding “<“code> my javascript “<“/code> to the text box in wordpress above my page contents? I just tried that and all I get is a blank page with the comments from the script shown. Am I doing it right?

    I have tried with my javascript as well as a simple hello world test script and they both display blank

    • This reply was modified 9 years, 5 months ago by SFBandit.
    #529699

    Success!

    I have managed to run a simple Javascript code on the page using what you mentioned. Thank you very much. I will now go away and try and sort my larger code out.

    Many thanks for your time and patience.

    P.S

    We are really liking the Enfold theme keep up the good work :-)

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Add custom javascript to page’ is closed to new replies.