Reply To: jQuery Tabs

NapitWPTech Theme Support Forums Masonry Brick jQuery Tabs Reply To: jQuery Tabs

#357

polov
Participant

Eureka! 🙂
it’s explained here: h ttps://www.wpbasics.org/2016/01/05/how-to-add-jquery-ui-tabs-to-wordpress/

1 – create a .js file with the code:
jQuery( function() {
jQuery( "#tabs" ).tabs();
} );

add this .js in your theme
for me name of file is: “tabsjquery.js”

2 – add in your “functions.php”:
function my_scripts_tabs() {
if ( !is_admin() ) {
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script( 'custom-tabs', get_stylesheet_directory_uri() . '/tabsjquery.js', array('jquery'));
}
}
add_action('wp_enqueue_scripts', 'my_scripts_tabs');

3 – For add style:
– download the ui-core here
h ttp://jqueryui.com/download/#!version=1.12.1&components=111111111111111111111111111111111111111111111111
clic Download

– decompress .zip and add the folder name “jquery-ui-1.12.1.custom” in your Theme

– add this code in your functions.php:
wp_register_style('jquery-custom-style', get_stylesheet_directory_uri().'/jquery-ui-1.12.1.custom/jquery-ui.css', array(), '1', 'screen');
wp_enqueue_style('jquery-custom-style');

ok