WP Residence Help WP Residence Help

  • WpEstate
  • How to Build Your Website
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code Required, WpResidence 5.0 / Configuring the Primary Navigation Menu in WPResidence

Configuring the Primary Navigation Menu in WPResidence

1053 views 0

Configuring the Primary Navigation Menu in WPResidence

The primary navigation menu is a crucial element of your real estate website, guiding visitors to important sections of your site. WPResidence offers robust options for creating and customizing your navigation menu. This guide will walk you through the process of setting up, styling, and optimizing your primary navigation menu.

Creating Your Primary Navigation Menu

To begin, let’s create a new menu and set it as your primary navigation:

  1. Log in to your WordPress admin dashboard
  2. Navigate to Appearance > Menus
  3. Click on “create a new menu” at the top of the page
  4. Give your menu a name (e.g., “Primary Navigation”)
  5. Under “Menu Settings” at the bottom, check the box for “Primary Menu”
  6. Click “Create Menu”

Adding Items to Your Menu

Now that you’ve created your menu, it’s time to add items:

  1. On the left side of the Menus page, you’ll see boxes for Pages, Posts, Custom Links, and Categories
  2. Select the items you want to add to your menu
  3. Click “Add to Menu”
  4. Drag and drop menu items to arrange them in your desired order
  5. To create dropdown menus, drag menu items slightly to the right to make them sub-items
  6. Click “Save Menu” when you’re satisfied with the arrangement

Customizing Menu Items

WPResidence allows for advanced customization of menu items:

Adding Icons to Menu Items

  1. Click the arrow next to a menu item to expand its options
  2. In the “CSS Classes” field, add a class for your desired icon (e.g., “fas fa-home” for a home icon using Font Awesome)
  3. Save your menu

Adding Description to Menu Items

  1. In the Menus page, click “Screen Options” at the top right
  2. Check the box for “Description”
  3. You can now add descriptions to your menu items, which may appear depending on your theme settings

Styling Your Navigation Menu

To customize the look of your navigation menu, you can add custom CSS to your child theme’s style.css file:

Changing Menu Font and Color


.navbar-nav > li > a {
font-family: 'Arial', sans-serif;
font-size: 16px;
color: #333333;
}
.navbar-nav > li > a:hover {
color: #0073e1;
}

Styling Dropdown Menus


.dropdown-menu {
background-color: #f8f8f8;
border: 1px solid #e7e7e7;
}
.dropdown-menu > li > a {
color: #333333;
}
.dropdown-menu > li > a:hover {
background-color: #e7e7e7;
}

Mobile Menu Customization

Ensure your menu is mobile-friendly with these customizations:


@media (max-width: 768px) {
.navbar-nav > li > a {
font-size: 14px;
padding: 10px 15px;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
margin: 7.5px -15px;
}
.navbar-nav > li {
float: none;
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
}
}

Advanced Menu Customizations

Adding a Search Bar to Your Menu

To add a search bar to your navigation menu, you can use a custom walker class. Here’s how:

  1. Create a new file in your child theme folder called custom-nav-walker.php
  2. Add the following code to this file:


class Custom_Nav_Walker extends Walker_Nav_Menu {
function end_el(&$output, $item, $depth=0, $args=array()) {
if ($item->title == 'Search') {
$output .= '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '">
<input type="text" value="' . get_search_query() . '" name="s" id="s" placeholder="Search..."/>
<input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
</form>';
}
$output .= "</li>\n";
}
}

  • In your child theme’s functions.php file, add:


require_once('custom-nav-walker.php');
function custom_nav_menu_args($args) {
return array_merge($args, array(
'walker' => new Custom_Nav_Walker()
));
}
add_filter('wp_nav_menu_args', 'custom_nav_menu_args');

  • Add a menu item with the title “Search” where you want the search bar to appear

Creating a Mega Menu

WPResidence supports mega menus for displaying large amounts of content. To create a mega menu:

  1. In your menu structure, create a top-level menu item
  2. Add multiple columns of sub-menu items beneath it
  3. In the WPResidence theme options, ensure mega menus are enabled
  4. Style your mega menu using custom CSS in your child theme

Troubleshooting Common Menu Issues

If you encounter issues with your navigation menu, try these solutions:

  • Menu items not appearing: Ensure you’ve assigned your menu to the “Primary Menu” location
  • Dropdown menus not working: Check your JavaScript console for errors and ensure your theme’s JavaScript files are loading correctly
  • Menu styling inconsistencies: Use your browser’s inspector tool to identify conflicting CSS rules
  • Mobile menu not collapsing: Verify that your theme’s responsive JavaScript is functioning properly

Conclusion

A well-configured primary navigation menu enhances user experience and helps visitors easily find the information they need on your real estate website. By utilizing WPResidence’s menu options and implementing custom styling and functionality, you can create a navigation system that is both attractive and effective. Remember to always test your menu across different devices and browsers to ensure consistent functionality and appearance.

Technical how to | Custom Code RequiredWpResidence 5.0

Related Articles

  • Technical – How to Change the Minimum Image Dimensions for Property Uploads in WPResidence
  • Introduction to WPResidence Header Customization
  • Understanding WPResidence Header Types: An Overview
  • Customizing the WPResidence Logo Display

WP Residence Documentation

  • 1. General
    • How to Get Support
    • Get your buyer license code.
    • Use SSL / https
    • Server / Theme Requirements
  • 2. Installation
  • 3. Installation FAQ
  • 4. Advanced Search
    • Advanced Search Display Settings
    • Advanced Search Form
    • Geolocation Search for Half Map
    • Save Search Theme Options
    • Advanced Search Colors
  • 5. Agent, Agency & Developers
  • 6. Property Page
  • 7. Properties List
  • 8. Property Taxonomies
  • 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
  • Theme Options
    • 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
  • Translation
  • FAQ
  • Pages
  • Header
  • Footer
  • Google or Open Street Maps
  • Payment Options
  • Plugins
    • Included Plugins
    • Third Party Plugins – IDX Compatibility
    • Third Party Plugins – Multi Languages
    • Third party Plugins – Other
  • Technical
    • Technical how to | Custom Code Required
    • Technical: Child Theme

Join Us On

Powered by WP Estate - All Rights Reserved
  • WpEstate
  • How to Build Your Website
  • Video Tutorials
  • Client Support
  • API