Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other js in WordPress

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #38587
    kloy
    Member

    OK, I was having this issues in another thread, but I didn’t really know how to ask the right question. I figured out my beef with scripts and plug-ins that are not specially made for WP. Many times it requires a block of js code in the HTML file…right? And for some reason, for me, that seems to screw things up. The answer I guess would be to put it in the functions.php file, but I can never seem to touch that file without screwing it up.

    #104681
    TheDoc
    Member

    I’m wondering how your theme is set up? Only in very rare circumstances should you be inserting JS through a Post or Page. You should be editing your theme (most likely the header.php) to include JS files.

    #104683
    kloy
    Member

    not in a post/page…Sometimes you need to enter script tags in the header.php file and then add a block of code (even though it’s already linking to an external js file) in the head tag or right after the footer tage. Does that make sense?
    I was doing that a lot when I was building site with Dreamweaver.

    #104690
    TheDoc
    Member

    Totally makes sense.

    Can you give an example of what you’ve tried that has screwed something up?

    #104694
    kloy
    Member

    I was trying to use this plug-in for a Dynamic Grid Layout.

    http://www.wookmark.com/jquery-plugin
    https://github.com/GBKS/Wookmark-jQuery

    #104695
    TheDoc
    Member

    It looks pretty simple, how are you including it in your theme files?

    #104698
    kloy
    Member

    I entered the external js in a script tag in the head, and then that block of code at the bottom, right before the closing body tag….that’s the way they have it in their example. It didn’t work. Could it have been conflicting with something in the functions.php file? I’m not touching that. When it comes to js I only copy and paste.

    I have since found a WP plugin for this behavior, but would still like to know how to deal with these non-WP plug-ins.

    #104700
    TheDoc
    Member

    This line:

    Needs to go after you include jQuery – sounds like you might have accidentally been putting it before.

    #104823
    kloy
    Member

    I made sure the script tags were in order and still couldn’t get it to work.

    One script I am trying to use requires a block of js in the head tag and another right before the closing body tag. I have a feeling it’s just too easy to have conflicts??

    I tried putting them the theme .php files, I also found a few wordpress plug-ins that allow custom js and css per page and it’s still not working.

    Anyway, thanks for trying to help

    #104833
    kloy
    Member

    that’s the thing…everytime I try to do anything to the functions.php file I screw it up.
    I’d rather not touch it

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Other’ is closed to new topics and replies.