Home › Forums › WoodMart support forum › Hide empty categories on page tittle
Hide empty categories on page tittle
- This topic has 11 replies, 3 voices, and was last updated 5 years, 5 months ago by
Elise Noromit.
-
AuthorPosts
-
September 9, 2019 at 10:57 pm #142846
prokurentParticipantHey. Can you write how to hide empty categories in page tiitle categories menu?
ThanksAttachments:
You must be logged in to view attached files.September 9, 2019 at 11:03 pm #142848
prokurentParticipantI would like to display all categories as a drop-down list, but let them hide those categories where there are no products.
September 10, 2019 at 7:37 am #142897
Elise NoromitMemberHello,
Option “Categories in page title” will show the categories menu generated automatically based on all categories in the shop. It is not possible to manage this menu as other WordPress menus. By default, sub-categories will be displayed as the drop-down list
Best Regards
September 10, 2019 at 7:57 am #142899
prokurentParticipantSomeone else had the same problem and you sent the code. Unfortunately for me this code does not want to work – enter the code error when I add snippet
https://xtemos.com/forums/topic/how-to-hide-empty-categories/
“Don’t Panic
The code snippet you are trying to save produced a fatal error on line 62:Cannot redeclare woodmart_product_categories_nav() (previously declared in /var/web/site/public_html/wp-content/themes/woodmart/inc/integrations/woocommerce/template-tags.php:616)
The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.”
September 10, 2019 at 9:02 am #142914
Elise NoromitMemberHello,
Have you added the code to the functions.php of the child theme? Please provide your site admin access to the private area for checking.
Best Regards
September 10, 2019 at 9:31 am #142921
prokurentParticipantYes, I tried to add this code using the Snippets plugin and: “Don’t Panic
The code snippet you are trying to save produced a fatal error on line 62:Cannot redeclare woodmart_product_categories_nav() (previously declared in /var/web/site/public_html/wp-content/themes/woodmart/inc/integrations/woocommerce/template-tags.php:616)”
I tried to add in theme child editor and not working.
September 10, 2019 at 12:40 pm #142960
Eric WatsonParticipantHello,
Please, provide us your FTP access so we can log in and check this on your side.
Thank you in advance.
September 10, 2019 at 12:49 pm #142961
prokurentParticipantOK!
September 10, 2019 at 2:09 pm #142979
Elise NoromitMemberHello,
We have added the code, please check how it works now. If there are any problems, let us know.
Best Regards
September 10, 2019 at 2:35 pm #142983
prokurentParticipantOK thank you so much. I can see this code and I don’t understand why it didn’t work in Snippets Plugin …
Can you still write me how can I change the main image of woocommerce_single to another one? Eg woocommerce_product_thumbnails_large_size?
I have a lot of images that are tall but narrow – I made the thumbnails with a square plug Simple Resize Image but the template shows the main photos (woocommerce_single) that I can’t edit manually (5,000 photos)
I tried this code
add_filter(‘woocommerce_product_thumbnails_large_size’,
function(){ return ‘woocommerce_single’; });but not working.
September 10, 2019 at 4:49 pm #143010
prokurentParticipantUPDATE
Works well
add_filter(‘woocommerce_product_thumbnails_large_size’, function(){ return ‘woocommerce_single’; });
add_filter(‘woocommerce_image_sizes_to_resize’,’__return_empty_array’);September 10, 2019 at 8:07 pm #143036
Elise NoromitMemberYou are welcome! If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register