Forums

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

Home Forums JavaScript WordPress Sidebar

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #30903
    Attila Hajzer
    Participant

    i have tried so many ways to use my jQuery in wordpress for one of my sites. and i can’t figure out how to do it. the actual jQuery code works non-wordpress, but when i upload to wordpress it wont work.

    also i was wondering how do i edit/ manipulate the Sidebar for wordpress, like i know that you can change somethings in the admin panel under widgets but like how do i change the look of “recent posts” and all, like the formatting.

    #70923
    jcrp
    Member

    I think you have a problem with linking it with wordpress. Its is not straight forward like HTML where you define the path. You have to use a bit of wordpress tag to define its path. Like this –

    You first give the template directory followed by the jquery location.

    As for your second question you have to edit the sidebar.php file inside your themes folder.

    #70895
    jcrp
    Member

    Sorry dude. I added a script tag to show you, but it vanished. It think i embeded it wrong.
    Here is it anyway.

    #70845
    CoolAsCarlito
    Participant

    I would say no because on changing the template directory because I believe from my minimal experience of working with actual wordpress coding that you wouldn’t because bloginfo is a function of wordpress and template_directory is its parameter and is stored in your configurations.

    #70756
    SaraMarie
    Member

    Hey, rather than including jQuery that way (which will work), you should enqueue the script as it’s bundled in WordPress already. DigWP has an article on it here: http://digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/

    This took me a few times before I figured it out, but now I have far less problems. Also, even if you aren’t using this method, I think it’s better to link to the jQuery file hosted by Google. The only downside is if you need to test pages while your Internet is down, I guess.

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