Forums

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

Home Forums Back End Slide and Push Menu in WordPress

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #174214
    Ayanize
    Participant

    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

    #174215
    Paulie_D
    Member

    exmaple

    Is that a typo?

    Anyway…not much we can do without a link?

    #174217
    Ayanize
    Participant

    unfortunately, 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

    #174225
    Senff
    Participant
    wp_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.

    #174580
    Ayanize
    Participant

    Thanks 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.

    #174650
    __
    Participant

    wp_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

    They’re allowed, though not necessary in this case.
    reference.

    #174783
    Ayanize
    Participant

    @wahhabb

    Thanks 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.

    #174840
    wahhabb
    Participant

    It’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.

    #175052
    Ayanize
    Participant

    @wahhabb

    Thanks 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. :)

    #237753
    vvaroczi
    Participant

    Can 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.php

    add_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

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