Ecommerce Shopify WordPress Discussion

How can I jump to the first sub menu item of a top menu item in WordPress?

I have a WordPress site with a top menu, and some top menu entries have sub menus, like this: top1 top2 top3 sub1 sub2 sub3 top4 top5 subs 1, 2 and 3 are sub menus of top3. top3 is actually empty, it just serves as a container for its 3 subs. I'd like to navigate automatically to sub1 when top3 is clicked. I know that there's a solution for this, I've seen it many years ago but can't remember where...just a tiny snippet in functions.php. Tried a shortcode with wp_redirect, but it doesn't work: function goto_adresse_function() { if (!is_admin()) { wp_redirect( 'kontakt/adresse'); } } add_shortcode('goto_adresse', 'goto_adresse_function');
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.