- This topic is empty.
-
AuthorPosts
-
July 1, 2014 at 6:12 am #174214AyanizeParticipant
Hi,
I wish to implement what’s given here http://tympanus.net/codrops/2013/04/17/slide-and-push-menus/ in a WordPress site
I have already uploaded the HTML part in a text editor of a page.
I have then uploaded the CSS part in my themes’s child theme.
Then, I’ve uploaded the JavaScript coding in the parent theme’s js folder.
But nothing seemed to work.
then I placed
add_action( 'wp_enqueue_scripts', 'exmaple_enqueue' ); function exmaple_enqueue() { $ss_url = get_stylesheet_directory_uri(); wp_enqueue_script( 'menuk', "{$ss_url}/js/menuk.js" ); }
in my parent’s theme’s functions.php file.
but nothing is working.. not sure how to make it work in a WordPress.
Any help will be appreciative.
Thanks
July 1, 2014 at 6:15 am #174215Paulie_DMemberexmaple
Is that a typo?
Anyway…not much we can do without a link?
July 1, 2014 at 6:26 am #174217AyanizeParticipantunfortunately, it’s on a local host. Anyway, let me put it in a live server and provide you the link. Coming back in a few hours.
thanks
July 1, 2014 at 6:53 am #174225SenffParticipantwp_enqueue_script( 'menuk', "{$ss_url}/js/menuk.js" );
I’m not sure if the curly brackets make sense here or if they are even allowed, and it looks like you’re trying to load the JS file from the wrong directory (should not be the stylesheet directory).
Try this:
add_action( 'wp_enqueue_scripts', 'exmaple_enqueue' ); function exmaple_enqueue() { wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'menuk', get_template_directory_uri() . '/js/menuk.js', array(), '1.0.0', true ); }
Not sure if the first line in the function is necessary — maybe you load the jQuery library somewhere else, then again, maybe you don’t.
That’s about all the help we can offer without seeing a live site.
July 4, 2014 at 5:19 am #174580AyanizeParticipantThanks for your reply. Sorry I was late in response.
I also tried your functions, it’s not working either..
Anyway, this is the http://www.hindusenaindia.org/menu/ where I have pasted the HTML part. You can check out.
Let me know if you also need to have the login details which I will be glad to share.
Look forward to your reply.
July 4, 2014 at 4:28 pm #174650__Participantwp_enqueue_script( 'menuk', "{$ss_url}/js/menuk.js" );
I’m not sure if the curly brackets make sense here or if they are even allowedThey’re allowed, though not necessary in this case.
reference.July 6, 2014 at 4:06 am #174783AyanizeParticipantThanks a lot for this. I am completely newbie here, especially in js and all. Can you please take the pain and let me know how I can define classie in my WP installation, at least some sort of guidance here.
That will be highly kind of you.
Thanks a lot in advance.
July 6, 2014 at 12:28 pm #174840wahhabbParticipantIt’s the same as you’ve already done for menuk:
1) Download the classie.js file (I pointed you to the github repository, or get it from the example code)
2) Upload classie.js to your site’s js directory
3) Add another wp_enqueue_script line for it.Everything should work then.
July 9, 2014 at 6:29 am #175052AyanizeParticipantThanks a lot man.. Extremely sorry for the late response. I just tested it today and it’s really working fine. I am still working some customization though, the function is working nicely. Thank you once again. :)
February 5, 2016 at 3:50 pm #237753vvarocziParticipantCan someone help me out here
1, added html and ccs
2, uploaded classie.js to my js folder
3, created menu.js from the code from tutorial and uploaded to folder
4, added the below to function.phpadd_action( ‘wp_enqueue_scripts’, ‘exmaple_enqueue’ );
function exmaple_enqueue() {
wp_enqueue_script( ‘jquery’ );
wp_enqueue_script( ‘classie’, get_template_directory_uri() . ‘/js/classie.js’, array(), ‘1.0.0’, true );
wp_enqueue_script( ‘menu’, get_template_directory_uri() . ‘/js/menu.js’, array(), ‘1.0.0’, true );
}No joy :(
Anyone could help me out pls
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.