Last active
December 2, 2021 03:20
-
-
Save neilgee/aa2e1b1c59f078416899 to your computer and use it in GitHub Desktop.
Sidr in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$('#nav-toggle').sidr({ | |
name: 'sidr-right', | |
side: 'right', | |
source: '#menu-short, .search-form, .site-title' | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$('#nav-toggle').sidr({ | |
name: 'sidr-right', //name it | |
side: 'right', //position it | |
source: '' //add the content | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$('#nav-toggle').sidr({ | |
name: 'sidr-right', | |
side: 'right', | |
source: '#menu-short, .search-form, .site-title' | |
}); | |
$('#nav-toggle-left').sidr({ | |
name: 'sidr-left', | |
side: 'left', | |
source: '' | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Script-tac-ulous -> All the Sidr JS and CSS files | |
function themeprefix_scripts_styles_sidr() { | |
wp_enqueue_script ( 'sidrjs' , get_stylesheet_directory_uri() . '/js/jquery.sidr.min.js', array( 'jquery' ), '1', true ); | |
wp_enqueue_script ( 'sidrinit' , get_stylesheet_directory_uri() . '/js/sidr-init.js', array( 'sidrjs' ), '1', true ); | |
wp_enqueue_style ( 'sidrcss-dark' , get_stylesheet_directory_uri() . '/css/jquery.sidr.dark.css', '', '1', 'all' ); | |
//wp_enqueue_style ( 'sidrcss-light' , get_stylesheet_directory_uri() . '/css/jquery.sidr.light.css', '', '1', 'all' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'themeprefix_scripts_styles_sidr' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="mobile-icon"> | |
<a id="nav-toggle" href="#sidr">MENU</a> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#mobile-icon { | |
display: none; | |
} | |
@media only screen and (max-width: 800px){/*change to desired width*/ | |
#mobile-icon { | |
display: block; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment