WP Residence Help WP Residence Help

  • WpEstate
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / 26. Technical how to | Custom Code Required, 27. WPResidence 5.0 / Implementing and Customizing Mega Menus in WPResidence

Implementing and Customizing Mega Menus in WPResidence

703 views 0

Content

  • What are Mega Menus in WPResidence
  • Enabling Mega Menus in WPResidence
  • Creating a basic Mega Menu
  • Creating a Mega Menu with WPResidence Studio
  • Assigning the Mega Menu to a menu item
  • Styling your Mega Menu
  • Adding icons to Mega Menu items
  • Creating a full-width image in Mega Menu
  • Adding a search bar to Mega Menu
  • Creating dynamic content in Mega Menus
  • Making Mega Menus responsive
  • Troubleshooting Mega Menu issues
  • Conclusion

Implementing and Customizing Mega Menus in WPResidence

Mega Menus offer an effective way to organize and display large amounts of navigation options in a visually appealing manner. WPResidence includes support for Mega Menus, allowing you to create complex navigation structures for your real estate website.

This guide keeps the classic customization ideas and also explains the current recommended setup using WPResidence Studio Templates.

What are Mega Menus in WPResidence

A Mega Menu is an expanded dropdown menu that can display multiple columns of links, headings, images, icons, and other custom content.

In WPResidence, Mega Menus can be used with:

  • default WordPress menus
  • default WPResidence headers
  • headers created with WPResidence Elementor Studio

The current recommended method is to build the Mega Menu content as a Studio Template and assign it to a top-level menu item from Appearance > Menus.

Enabling Mega Menus in WPResidence

In the current WPResidence system, Mega Menus are managed through the menu item options and Studio Templates.

You do not need a separate global theme option such as Enable Mega Menus. Instead, the process is:

  1. Create the Mega Menu content as a Studio Template.
  2. Go to Appearance > Menus.
  3. Edit the top-level menu item.
  4. Enable Set as Mega Menu?.
  5. Select the corresponding Studio Mega Menu Template.
  6. Save the menu.

This is the updated WPResidence workflow for Mega Menus.

Creating a basic Mega Menu

The classic idea of a Mega Menu is still useful when planning the menu structure.

To create a basic Mega Menu concept:

  1. Go to Appearance > Menus in your WordPress dashboard.
  2. Select your primary navigation menu or create a new one.
  3. Add a top-level menu item that will become your Mega Menu trigger.
  4. Plan the sections and groups of links you want to display inside the Mega Menu.
  5. Create the visual content for those sections in a Studio Template.
  6. Assign that template to the top-level menu item.
  7. Save your menu.

Older approaches often relied on large submenu structures only. In the current setup, the recommended layout is built visually with Elementor inside a Studio Mega Menu template.

Creating a Mega Menu with WPResidence Studio

This is the recommended method for current WPResidence versions.

  1. Go to Studio Templates in wp-admin.
  2. Click Add Studio Template.
  3. Add a title for the template so you can identify it later.
  4. Set Template Type to Mega Menu.
  5. Set Custom template should be full width? based on the design you want. In many cases, Yes is recommended.
  6. Make sure the page template is set to Elementor Full Width.
  7. Click Edit with Elementor.
  8. Design the Mega Menu content using containers, headings, icon lists, images, and links.
  9. Save or publish the template.

For a full dedicated tutorial, see:

Mega Menu with WPResidence Studio

Note: The width of the Mega Menu panel matches the Elementor container structure used in the Studio template. A boxed layout appears centered, while a full width layout spans the full available area.

Assigning the Mega Menu to a menu item

After the Studio Mega Menu template is created, assign it to the desired top-level menu item.

  1. Go to Appearance > Menus.
  2. Open the menu item that should trigger the Mega Menu.
  3. Check Set as Mega Menu?.
  4. In the Studio Mega Menu Template dropdown, select the template you created.
  5. Save the menu.

Once saved, that top-level item will display the selected Studio template as a Mega Menu on the front end.

This works for standard WPResidence menus and for menus shown in headers built with WPResidence Elementor Studio.

Styling your Mega Menu

WPResidence provides a base structure for Mega Menus, but you can customize it further. Add custom CSS to your child theme style.css file when needed.

.wpresidence-navigation-menu .menu-item-has-megamenu {
position: static;
}
.wpresidence-navigation-menu .megamenu {
position: absolute;
left: 0;
right: 0;
padding: 15px;
background-color: #ffffff;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.wpresidence-navigation-menu .megamenu-column {
float: left;
width: 25%;
padding: 0 15px;
}
.wpresidence-navigation-menu .megamenu-title {
font-weight: bold;
margin-bottom: 10px;
color: #333333;
}
.wpresidence-navigation-menu .megamenu-column ul {
list-style: none;
padding: 0;
margin: 0;
}
.wpresidence-navigation-menu .megamenu-column li {
padding: 5px 0;
}
.wpresidence-navigation-menu .megamenu-column a {
color: #666666;
text-decoration: none;
}
.wpresidence-navigation-menu .megamenu-column a:hover {
color: #0073e1;
}

When using Studio Templates, much of the visual design can be controlled directly in Elementor, and CSS should be used only for additional refinements.

Adding icons to Mega Menu items

You can enhance your Mega Menu with icons.

  1. Edit a menu item in Appearance > Menus.
  2. In the CSS Classes field, add a class for your desired icon, for example fas fa-home for a Font Awesome icon.

Then add CSS to style the icons:

.wpresidence-navigation-menu .megamenu-column li i {
margin-right: 5px;
width: 20px;
text-align: center;
}

If your Mega Menu is built in Studio Templates, you can also use Elementor icon widgets or icon lists instead of relying only on menu item CSS classes.

Creating a full-width image in Mega Menu

To add a full-width image to your Mega Menu, older setups often used a custom menu walker. That approach can still work for advanced custom development.

Create a file named custom-mega-menu-walker.php in your child theme and add the following code:

<?php
class WPResidence_Mega_Menu_Walker extends Walker_Nav_Menu {
function start_lvl(&$output, $depth = 0, $args = array()) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul class=\"sub-menu\">\n";
if ($depth === 0) {
$output .= "<li class=\"megamenu-full-width-image\"><img src=\"/path/to/your/image.jpg\" alt=\"Full Width Image\"></li>";
}
}
}

Then, in your child theme functions.php file, add:

require_once get_stylesheet_directory() . '/custom-mega-menu-walker.php';
function custom_mega_menu_walker($args) {
return array_merge($args, array(
'walker' => new WPResidence_Mega_Menu_Walker()
));
}
add_filter('wp_nav_menu_args', 'custom_mega_menu_walker');

Style the full-width image with CSS:

.megamenu-full-width-image {
width: 100%;
padding: 0;
margin-bottom: 15px;
}
.megamenu-full-width-image img {
width: 100%;
height: auto;
display: block;
}
Recommended: In most current WPResidence setups, it is easier and safer to place images directly inside the Mega Menu Studio Template with Elementor instead of customizing the menu walker.

Adding a search bar to Mega Menu

To include a search bar in your Mega Menu, older custom setups can extend the menu walker with custom output.

Add this to your custom menu walker:

function end_lvl(&$output, $depth = 0, $args = array()) {
if ($depth === 0) {
$output .= "<li class=\"megamenu-search\">
<form role=\"search\" method=\"get\" id=\"searchform\" action=\"" . home_url('/') . "\">
<input type=\"text\" value=\"" . get_search_query() . "\" name=\"s\" id=\"s\" placeholder=\"Search properties...\"/>
<button type=\"submit\" id=\"searchsubmit\">Search</button>
</form>
</li>";
}
$indent = str_repeat("\t", $depth);
$output .= "$indent</ul>\n";
}

Style the search bar:

.megamenu-search {
width: 100%;
padding: 15px;
}
.megamenu-search form {
display: flex;
}
.megamenu-search input[type="text"] {
flex-grow: 1;
padding: 8px;
border: 1px solid #ddd;
}
.megamenu-search button {
padding: 8px 15px;
background-color: #0073e1;
color: #ffffff;
border: none;
cursor: pointer;
}

In current setups, this type of block can also be added visually inside a Studio Mega Menu template with Elementor widgets and custom layouts.

Creating dynamic content in Mega Menus

You can populate your Mega Menu with dynamic content, such as recent listings. Older advanced setups can do this through a custom menu walker.

Add this to your custom menu walker:

function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) {
if ($item->object == 'custom' && $item->classes[0] == 'dynamic-listings') {
$output .= "<li class=\"megamenu-column dynamic-listings\"><h4>Recent Listings</h4>";
$recent_listings = new WP_Query(array(
'post_type' => 'estate_property',
'posts_per_page' => 3
));
if ($recent_listings->have_posts()) {
while ($recent_listings->have_posts()) {
$recent_listings->the_post();
$output .= "<div class=\"megamenu-listing\">";
$output .= "<a href=\"" . get_permalink() . "\">" . get_the_title() . "</a>";
$output .= "<span class=\"megamenu-listing-price\">" . get_post_meta(get_the_ID(), 'property_price', true) . "</span>";
$output .= "</div>";
}
}
wp_reset_postdata();
$output .= "</li>";
} else {
parent::start_el($output, $item, $depth, $args, $id);
}
}

Style the dynamic listings:

.megamenu-column.dynamic-listings {
width: 33.33%;
}
.megamenu-listing {
margin-bottom: 10px;
}
.megamenu-listing a {
display: block;
font-weight: bold;
}
.megamenu-listing-price {
color: #0073e1;
}

For most sites, building the Mega Menu visually with Elementor Studio templates is easier to maintain. For highly dynamic content, custom development in a child theme remains an advanced option.

Making Mega Menus responsive

Ensure your Mega Menus look good on all devices:

@media (max-width: 768px) {
.wpresidence-navigation-menu .megamenu {
position: static;
width: 100%;
padding: 0;
}
.wpresidence-navigation-menu .megamenu-column {
width: 100%;
float: none;
}
.megamenu-full-width-image,
.megamenu-search {
display: none;
}
}

When using Elementor Studio templates, also check the responsive controls inside Elementor so the layout remains readable on tablet and mobile devices.

Troubleshooting Mega Menu issues

If you encounter problems with your Mega Menus, try these solutions:

  • Mega Menu not appearing: Confirm that Set as Mega Menu? is enabled and that a Studio Mega Menu template is selected for the correct top-level item.
  • Styling issues: Check for conflicting CSS and use your browser inspector tool to debug.
  • Custom content not showing: Verify that your Studio template is published and selected correctly, or confirm that your custom walker is properly hooked if using code-based customizations.
  • Performance concerns: Optimize images and limit the amount of dynamic content to improve load times.
  • Wrong width or layout: Check the Studio Template settings, especially Template Type, Custom template should be full width?, and the page template Elementor Full Width.

Conclusion

Mega Menus in WPResidence offer a powerful way to enhance your website navigation and showcase important content.

By using WPResidence Studio Templates, standard WordPress menus, and optional custom CSS or child theme code, you can create Mega Menus that are both functional and visually appealing.

The recommended modern approach is to create the Mega Menu content in Studio Templates and assign it from Appearance > Menus. For highly custom or dynamic behavior, the child theme customization examples above can still be used as advanced solutions.

Always test your Mega Menus across different devices and browsers to ensure a consistent user experience.

26. Technical how to | Custom Code Required27. WPResidence 5.0

Related Articles

  • Webhook Integration for Contact Forms
  • Technical: Change the Schedule Tour Email Text and the Form Default Message
  • Property list filter customization
  • Technical – How to Change the Minimum Image Dimensions for Property Uploads in WPResidence

WP Residence Documentation

  • 01. Getting Started
    • How to Get Support
    • Get your buyer license code.
    • Use SSL / https
    • Server / Theme Requirements
  • 02. Installation & Setup
  • 03. Installation FAQ
  • 06. Search & Filtering
    • Advanced Search Display Settings
    • Advanced Search Form
    • Geolocation Search for Half Map
    • Save Search Theme Options
    • Advanced Search Colors
  • 09. Agent, Agency & Developers
  • 08. Property Pages & Layouts
  • 07. Property Lists, Categories & Archive
  • 14. WPResidence Elementor Studio
  • 10. Blog Posts & Blog List
  • 11. Shortcodes
    • Contact Form
    • Featured Agency/Developer
    • Membership Packages
    • Testimonials
    • Google Map with Property Marker
    • Listings per Agent, Agency or Developer
    • Display Categories
    • Agent List
    • Recent Items Slider
    • Recent items
    • List Properties or Articles by ID
    • Featured Agent
    • Featured Article
    • Featured Property
    • Login & Register Form
    • Icon Content Box Shortcode
  • 12. Widgets
  • 04. Theme Options & Global Settings
    • General Settings
    • User Types Settings
    • Appearance
    • Logos & Favicon
    • Header
    • Footer Style and Colors
    • Price & Currency
    • Property Custom Fields
    • Features & Amenities
    • Listing Labels
    • Theme Slider
    • Permalinks
    • Splash Page
    • Social & Contact
    • Map Settings
    • Pin Management
    • How read from file works
    • General Design Settings
    • Custom Colors Settings
    • Header Design & Colors
    • Mobile Menu Colors
    • User Dashboard Colors
    • Print PDF Design
    • Property, Agent, Blog Lists Design Settings
    • Sidebar Widget Design
    • Font management
    • How to add custom CSS
    • Custom Property Card Unit – Beta version
    • Email Management
    • Import & Export theme options
    • reCaptcha settings
    • YELP API Integration
    • iHomefinder Optima Express IDX
    • MEMBERSHIP & PAYMENT Settings
    • Property Submission Page
    • PayPal Setup
    • Stripe Setup
    • Wire Transfer Payment Method
  • 20. Translations & Languages
  • 24. FAQ
  • 10. Pages
  • 11. Header
  • 12. Footer
  • 05. Maps & Location Settings
  • 18. Payments & Monetization
  • Plugins
    • 22. Third Party Plugins – IDX Compatibility
    • 21. Third-Party Plugins – Multi-Language
    • 23. Third party Plugins – Other
  • Technical
    • 26. Technical how to | Custom Code Required
    • 25. Technical: Child Theme

Join Us On

Powered by WP Estate - All Rights Reserved
  • WpEstate
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API