This topic has 15 replies, 5 voices, and was last updated 9 years, 1 months ago ago by Stan Russell
I don’t want the product-categories in the sidebar being opened by default. How can I prevent that?
i saw an answer on other 8theme theme, but i cannot find the file
script.js in woopress.
the solution was:
1. Open file /js/script.js
2. Remove (or better outcomment) this part: if(jQuery(’.categories-group.opened’).length > 0) { //jQuery(’.categories-group.has-subnav’).addClass(‘opened’); }else{ // If doesnt exitst opened point jQuery(’.categories-group.has-subnav:first’).addClass(‘opened’).find(‘ul’).show(); }
thanks
Hello,
To close first category, edit wp-content/themes/woopress/js/etheme.js file. Find and comment out line 1718
$this.find('>li').first().find('.open-this').html(minusIcon).parent().addClass('opened').find('ul.children').show();
Regards,
Robert Hall.
so its mean after every update i will need to do it again, right?
thanks!
p.s. i never edited that file, but that line its on LINE 1808.
and by the way, its just between the ELSE code, so i should comment out like that:
else {
// $(this).html(minusIcon).parent().addClass('opened').find('> ul, > div.nav-sublist-dropdown').slideDown(200); //
}
Hello,
Yes, but if you’ll use the Child Theme you can save it.
https://www.8theme.com/demo/docs/woopress/index.html#!/3_child_theme
Please copy this file with changes into it saving folder structure like:
wp-content/themes/woopress_child/js/etheme.js.
Regards,
Robert Hall.
Hello,
You can create child theme https://codex.wordpress.org/Child_Themes and make changes there.
You need add the code in your child theme functions.php file:
add_action( 'wp_enqueue_scripts', 'etheme' );
function etheme() {
wp_enqueue_script( 'etheme', get_stylesheet_directory_uri() . '/js/etheme.js' );
}
Then create “js” folder in child theme and copy etheme.js file with needed changes in the child theme “js” directory so you won’t lose modifications after theme update.
Best regards,
Jack Richardson.
thanks,
please can you read again my last REPLY over here, as i edit it…
thanks
Please see screenshot to understand how to do it – http://prntscr.com/8vu4jw
Also you can provide us with FTP credentials and we’ll help you with that.
Regards,
Robert Hall.
even i already read all the things about child theme, and seems i almost understood everything, it with be great if you can do that for me, than i can see what you did and learn from it.
big thanks
Hello,
I’ve created the Child Theme for you. You can active it in Dashboard->Appearance->Themes.
Also please clear all cache.
Regards,
Robert Hall.
it is possible that woocommerce update FIX the problem?
as i never activate the child theme, and its already working fine.
thanks anyway
Hello,
Could you please clarify what problem should be fixed after Woocommerce update?
Regards,
Eva Kemp.
i mean, i asked to make that all categories will be CLOSED automaticly.
and you guys help out, but before i even activate my child theme, i saw i had UPDATE for woocommerce, so i did the update.
and the “problem” with the opened categories were FIXED already.
Hello,
So is your issue resolved?
Best regards,
Jack Richardson.
seems like that, just dont understand if i really need that child theme or not.
as it all happen in the same time. the woocomerce update and the upload of a child theme by 8theme suport (again, without activate the child theme).
thanks anyway
Hello do0rway,
you are welcome!
Regards,
Stan Russell.
The issue related to '‘how to DISABLE product-categories opened by default’' has been successfully resolved, and the topic is now closed for further responses