How to add custom javascript to my wordpress theme

  • Author
  • #1153822

    I run the Shopnix Blog. I have got to customize most of the look & feel + functionality for the blog. But now I’m struck @ a critical step. I need to add some custom javascript to a button I’ve listed on the page & finding it extremely difficult.

    I have right now added the button as a weblink with anchor (Check the blog & you will notice the “Build an online store!” button)

    I’ve embedded the button using the “Text links” widget.

    The functionality i need for the button is something like what you can find on the – Shopnix Homepage. Click the “Get free store now” button.

    Looking forward to the responses.



    I’m sorry, but such embed code will not work because we remove JavaScript, Flash, iframe, form, and input tags for security reasons.

    You can use an image widget to add the button:


    Hi Kardotim,

    Thanks for the response.

    Are you suggesting that the image widget will allow me to have embed code?

    Cause when i looked the link you shared, it just mentions linked URL.

    I’ve been able to achieve the look & feel i wanted for the button, I just need to add my own custom HTML + JS functionality associated with that button.

    If thats possible with the image widget, i’ll surely give it a try.



    The image URL allows you to add an existing image (eg the button) and a hyperlink to it. You can take a screenshot of the existing button, upload that to your blog’s media library, and add that as the image to your image widget.

    As mentioned before, we remove JavaScript for security reasons. Note that there are no restrictions if you setup a self-hosted blog instead of a blog, but there are some added responsibilities. We have hosting recommendations at the following link if you are interested.

The topic ‘How to add custom javascript to my wordpress theme’ is closed to new replies.