Jump to content


Photo
- - - - -

JQuery Plugins - how to?


  • Please log in to reply
3 replies to this topic

#1 ryanjohnjackson

ryanjohnjackson

    Super Member

  • Members
  • 143 posts

Posted 13 December 2011 - 09:04 PM

Hi,

So, I've been reading up a bunch and I'm still lost on this. I wish to add a jquery plugin called "advanced search" just after my nav. I think I kinda got the hook but not sure about the function since its a bit beyond me at the moment.

I got the hook from here:

Please Login or Register to see this Hidden Content

and the video tutorial.
I have added text to my header area through php just not a plugin.

This is what I believe is part of what I need:

Please Login or Register to see this Hidden Content


I named the function advanced search.

What goes in between

Please Login or Register to see this Hidden Content


Is what I need to figure out.

I downloaded the plugin:

Please Login or Register to see this Hidden Content

and uploaded it to here:

Please Login or Register to see this Hidden Content

I also put this in my footer scripts area in pagelines.

I've read around on pagelines and I'm thinking I may need to add something like this:

Please Login or Register to see this Hidden Content


Does this look right? Bueller?

I also got some info from here

Please Login or Register to see this Hidden Content


Thanks

#2 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 13 December 2011 - 09:24 PM

Ok first, fair play for having a go!

Now, lets have a closer look. Your js script is in the wrong place for a start, you should never ever ever edit core wp files, or add new ones, breaks the ability to ever upgrade!

So lets assume you have the base theme installed and activated we will put the theme there.

so it becomes pagelines-template-theme/jquery.ryans_menu.js

Now you have attemted to load your js from inside the pagelines_section_after_postnav action, unfortunately the js will never load from here with wp_enqueue because its run too late. js needs to enqueued during wp_enqueue_scripts.

So that being said, your going to need to functions, one to include your js, and the other to work with it.

Please Login or Register to see this Hidden Content


Now you add your second functions to do the actual munu:

Please Login or Register to see this Hidden Content


Well i hope this gives you some pointers :) good luck!

#3 rzaidi

rzaidi

    Member

  • Members
  • PipPip
  • 14 posts
  • Framework Version:Platform Pro 1.5.3
  • Country: Country Flag

Posted 02 February 2012 - 04:17 AM

I need to figure this out as well...that is, how to include a custom jQuery script...I have two questions -- what file am i supposed to add the add_action stuff to?? also, does this also work with Pagelines 1.5?? My customer hasn't upgraded so I am still working with that...

#4 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 03 February 2012 - 03:07 AM

What kind of jQuery plugin are you trying to implement? Is it the same one? The file you're supposed to add the action to is the functions.php file. As for working with PageLines 1.5 (PlatformPro + PlatformBase), I don't see why it wouldn't work.