WordPress.org

Ready to get started?Download WordPress

Forums

Sliding Panel
[resolved] panel not opening with custom theme - quick fix (3 posts)

  1. pskiebe
    Member
    Posted 3 years ago #

    plugin version: 0.1
    theme: custom theme

    as mentioned in other forum posts, panel.js isn't loaded sometimes. a quick fix that worked for me:
    change last argument of function wp_enqueue_script on line 77 in sliding-panel.php to false. this loads panel.js in the header. seems to be an issue with some themes not loading footer scripts correctly.

    sliding-panel.php, line 77:
    wp_enqueue_script( 'sliding-panel-js', SLIDING_PANEL_URL . '/panel.js', array( 'jquery' ), '0.1', true );
    to
    wp_enqueue_script( 'sliding-panel-js', SLIDING_PANEL_URL . '/panel.js', array( 'jquery' ), '0.1', false );

    for me it does the trick but i'm open for any suggestions on how to solve this properly.

  2. Justin Tadlock
    Member
    Plugin Author

    Posted 3 years ago #

    Most likely, your theme doesn't appropriately call the wp_footer hook.

  3. pskiebe
    Member
    Posted 3 years ago #

    *facepalm*
    Thanks a lot, that was exactly the problem. I inserted the wp_footer hook:
    wp_footer();
    in my theme's footer.php just before the closing </body> tag and erverything is working smoothly now. panel.js is added to the footer as it is supposed to without any modifications to the plugin code.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic