SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Apr 2010
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpress and JQuery

    Is it possible to embed a JQuery script in the header of a Wordpress blog? If so, does anyone know of any tutorials that would give a few guidelines or pointers on how to go about this?

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Is this a self hosted WP blog or are you using WP.com? If the latter is the case than I can't say, but if it's self hosted than yes it's possible and there is no difference than any other site. Other than you have to edit only one file: header.php (depending on the theme that is)

    I just found this: http://codex.wordpress.org/Function_...enqueue_script

  3. #3
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,235
    Mentioned
    239 Post(s)
    Tagged
    1 Thread(s)
    You just need to google a bit to find lots of tutorials about this.

    JQuery library comes packed with JQuery so you only need to add your <script> tags (src attribute or not) whenever you want to place them in your code/template. Exception made if you want to load JQuery from your own folders or from Google' servers. Then you will need to break the hook from WordPress.

    Edit: RetroNetro is right. If you host at wordpress.com then you may not be able to do as many changes as you want

  4. #4
    SitePoint Addict
    Join Date
    Apr 2010
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replies. Yes, I am self hosting but new to Wordpress. The link was really helpful.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •