Home › Forums › WoodMart support forum › Delete the "categories" dropdown in the mobile version
Delete the "categories" dropdown in the mobile version
- This topic has 8 replies, 2 voices, and was last updated 6 years, 10 months ago by Artem Temos.
-
AuthorPosts
-
February 2, 2018 at 11:08 pm #37100
AntonioParticipantHi, I’m very happy with your template but I have no idea how to speak English.
Delete the “categories” dropdown in the mobile version when the category that is being displayed does not have any child category.
Add 2 screenshots to try to explain what I need to do on my website.
I love what you are, keep working this well
a greeting
Attachments:
You must be logged in to view attached files.February 3, 2018 at 8:23 am #37122
Artem TemosKeymasterHello,
We are glad to know that you considered using WoodMart for your web-site. I hope you will be happy with it.
Try to add the following code snippet to the Custom CSS area for mobile devices only in Theme Settings to remove them
.woodmart-show-categories { display: none!important; }
By the way, may we use your website in our theme showcase on ThemeForest? It looks very nice and clean so we would like to share it as an example for our potential customers.
Kind Regards
XtemosFebruary 3, 2018 at 10:04 am #37148
AntonioParticipantIt worked perfect.
I am working very hard to create the best possible user experience using your tool.
Of course you can use my website as an example of what can be done with your template.
Thank you for your comment, I hope you continue to serve your users so well and that you continue creating content of such quality.
A greeting from Spain
February 3, 2018 at 10:38 am #37159
AntonioParticipantSorry but I rushed?
I checked that the code worked well with the categories that do not have subcategories but also eliminates the function with which if they have them
I send some screenshots to try to explain graphically
Thank you very much for your support
Attachments:
You must be logged in to view attached files.February 3, 2018 at 1:08 pm #37190
Artem TemosKeymasterTry to enable option called
Show category neighbors if there is no children
in Theme Settings -> Shop -> Sidebar & Page title.February 3, 2018 at 3:53 pm #37232
AntonioParticipantThat does not work either, the idea is that the “drop down of categories” works the same in mobile version and desktop version. That when you reach a category, in this case “white gold alliances” that does not have a lower category, the drop-down disappears.
I suppose it will have to be through some CSS code but not the one we tried before because that what it does is to completely eliminate the “categories dropdown”.
Anyway, thank you very much for your help, if you find the solution please follow this thread.
A greeting 😉
February 4, 2018 at 11:30 am #37311
Artem TemosKeymasterTry to add the following PHP code snippet to the child theme functions.php file to do this
function woodmart_product_categories_nav() { global $wp_query, $post; $show_subcategories = woodmart_get_opt( 'shop_categories_ancestors' ); $list_args = array( 'taxonomy' => 'product_cat', 'hide_empty' => false ); // Menu Order $list_args['menu_order'] = false; $list_args['menu_order'] = 'asc'; // Setup Current Category $current_cat = false; $cat_ancestors = array(); if ( is_tax( 'product_cat' ) ) { $current_cat = $wp_query->queried_object; $cat_ancestors = get_ancestors( $current_cat->term_id, 'product_cat' ); } $list_args['depth'] = 5; $list_args['child_of'] = 0; $list_args['title_li'] = ''; $list_args['hierarchical'] = 1; $list_args['show_count'] = woodmart_get_opt( 'shop_products_count' ); $list_args['walker'] = new WOODMART_Walker_Category(); $class = ( woodmart_get_opt( 'shop_products_count' ) ) ? 'has-product-count' : 'hasno-product-count'; $shop_link = get_post_type_archive_link( 'product' ); include_once( WC()->plugin_path() . '/includes/walkers/class-product-cat-list-walker.php' ); if( !get_term_children( $current_cat->term_id, 'product_cat' ) ) return; echo '<div class="woodmart-show-categories"><a href="#">' . esc_html__('Categories', 'woodmart') . '</a></div>'; echo '<ul class="woodmart-product-categories ' . esc_attr( $class ). '">'; echo '<li class="cat-link shop-all-link"><div class="category-nav-link"><a href="' . esc_url( $shop_link ) . '"> <span class="category-summary"> <span class="category-name">' . esc_html__('All', 'woodmart') . '</span> <span class="category-products-count"> <span class="cat-count-label">' . esc_html__('products', 'woodmart') . '</span> </span> </span> </a></div></li>'; if( $show_subcategories ) { woodmart_show_category_ancestors(); } else { wp_list_categories( $list_args ); } echo '</ul>'; }
February 5, 2018 at 5:23 pm #37607
AntonioParticipantThank you very much for your help.
In the end I decided to change the structure of the categories and leave the menu with the option that you show by default in the demo.
Anyway I think that this could be applied in your next update since it can be considered a small failure of the template.
A greeting.
February 5, 2018 at 7:46 pm #37642
Artem TemosKeymasterGreat, yes, we will consider implementing it in our future updates.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register