Home Forums WoodMart support forum "Product Categories" dropdown label as a button/link

"Product Categories" dropdown label as a button/link

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #331892

    aquadark
    Participant

    Hello,

    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.
    #332157

    Luke Nielsen
    Keymaster

    Hello,

    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

Viewing 2 posts - 1 through 2 (of 2 total)