WordPress.org

Ready to get started?Download WordPress

Forums

How to put JavaScript to under every post (4 posts)

  1. bloggertipsandtools
    Member
    Posted 1 year ago #

    I want to put JavaScript to under very post. I like to do it manually. ( Without using plugin). How can I do it?

  2. jnhghy
    Member
    Posted 1 year ago #

    Hi, we use plugins so we won't change theme core files because this files get overwritten when you update the theme. So first step would be to create a child theme.
    Copy the footer.php file the theme to the child theme and add your javascript there. To locate the post you can use the posr div id(depending on your theme it might have one or you'll have to add it.).What theme are you using? can you share a link to your site?
    Regards

  3. bloggertipsandtools
    Member
    Posted 1 year ago #

    Thanks for the reply :-) this is the my blog. http://bloggertipsandtools.com/. I am beginner for wordpress. But I have some knowledge about HTML,CSS,PHP and etc. If you don't mind please tell me what file I shroud change to add JavaScript to under every post. again thanks.

  4. Prasath Mani
    Member
    Posted 1 year ago #

    Hi,just add your Javascript code into end of the single.php file.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags