Open a page with a specific Tab opened – DiviMenus Flex module

Choose the initially open tab when the page loads!

When you open a page that includes the Tabs module within Divi, the first tab is displayed as the default open tab. In this tutorial, you will learn how to recreate a Tabs module using the DiviMenus Flex module and have the second tab open by default when the page loads.

Paste this into DiviMenus → Advanced → CSS ID:

If you set above an ID other than my-divimenu, please search the my-divimenu occurrences in the code below and change them for your custom ID.

Paste this into the Code Module*
jQuery(function($) {
if (window.location.hash) {
var hash = window.location.hash.substring(1);
if (!isNaN(parseInt(hash))) {
setTimeout(function() {
$('#my-divimenu .et_pb_divimenus_flex_item').eq(parseInt(hash)-1).find('.dd-mi>a').trigger('click');
}, 50);

* Place the previous code in between script tags:




Now you can refer to each Menu Item by adding a parameter at the end of your page URL.

For example, to simulate a click to the 1st Menu Item add this parameter:

Same for the remaining ones: (second Menu Item) (third Menu Item)

🥳 That’s it!

Want to link specific Tabs even more easily?

DonDivi Tabs module includes this functionality, which is part of our new plugin DonDivi Builder

👉 Subscribe to our YouTube channel

More Videos