Home › Forums › WoodMart support forum › "Product Categories" dropdown label as a button/link
"Product Categories" dropdown label as a button/link
- This topic has 1 reply, 2 voices, and was last updated 2 years, 10 months ago by Luke Nielsen.
-
AuthorPosts
-
November 15, 2021 at 10:32 am #331892
aquadarkParticipantHello,
Is it possible to make the “Product Categories” label (for the dropdown menu – see attached screenshot) also a hyperlink?
I would like to make it a button leading to the Product Archive (/shop) instead of a dedicated one elsewhere (for desktop and tablet).Thanks!
Attachments:
You must be logged in to view attached files.November 16, 2021 at 8:17 am #332157
Luke NielsenKeymasterHello,
Of course, it’s possible. Here is my decision:
First of all, you should copy the “categories.php” file (woodmart\header-elements\categories.php) to your child theme (woodmart-child\header-elements\categories.php). After that, in the copied “categories.php” file in the child theme, replace the HTML code below line 52 with this code
https://monosnap.com/file/pdhZOpTfiMLF7XUdWmiv1tW4gn7EmT
<div class="wd-header-cats<?php echo esc_attr( $extra_class ); ?>" role="navigation"> <a href="http://testwood/shop/"> <span class="menu-opener <?php echo esc_attr( $class ); ?>"> <?php if ( $icon_type == 'custom' ) : ?> <span class="menu-opener-icon custom-icon"><?php echo whb_get_custom_icon( $params['custom_icon'] ); ?></span> <?php else : ?> <span class="menu-opener-icon<?php echo woodmart_get_old_classes( ' woodmart-burger' ); ?>"></span> <?php endif; ?> <span class="menu-open-label"> <?php esc_html_e( 'Browse Categories', 'woodmart' ); ?> </span> </span> </a> <div class="wd-dropdown wd-dropdown-cats <?php echo esc_attr( $dropdowns_classes ); ?>"> <?php wp_nav_menu( array( 'container' => '', 'menu' => $params['menu_id'], 'menu_class' => 'menu wd-nav wd-nav-vertical' . woodmart_get_old_classes( ' vertical-navigation' ), 'walker' => new WOODMART_Mega_Menu_Walker(), 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s' . $html . '</ul>', ) ); ?> </div> </div>
To be able to change the hyperlink just replace the value of the
href
attribute.https://monosnap.com/file/OtyV0BeeTrZJ469CnstRmHTXTggoQF
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register