Introduction
Please follow the instructions below to replace Enfold’s menu with HeroMenu. The menu within Enfold will interfere with HeroMenu, so we have to update the header.php file to make sure that Enfold has no effect on HeroMenu.
Take Note
All changes are done within the header.php file. Start by making a backup of this file. Please also note in future that theme updates by the author might overwrite the header.php. So make sure that when you do a theme update, also do this bit in the header.php file again.
Manual Integration
Replace the following code within the header.php file:
<?php if(!$blank) //blank templates dont display header nor footer { //fetch the template file that holds the main menu, located in includes/helper-menu-main.php get_template_part( 'includes/helper', 'main-menu' ); } ?>
With the following –
<?php if(!$blank) //blank templates dont display header nor footer { if(!class_exists( 'hmenu_frontend')){ //fetch the template file that holds the main menu, located in includes/helper-menu-main.php get_template_part( 'includes/helper', 'main-menu' ); } else { wp_nav_menu( array( 'theme_location' => 'avia' ) ); } } ?>
Menu Location Settings
Navigate to Hero Menu » Settings » Menu Integration and set menu location to Avia.
Manual style changes
Before we can properly setup HeroMenu on Enfold we need add some css to the theme settings.
Navigate to Enfold » General Styling » Scroll down until you find the Quick CSS section and add the following styles to the provided input. Remember to save your changes!
.html_header_top #main{ padding-top:inherit; }
Pointer Class Update
Take Note
The following file update takes place within the main Enfold Theme files.
Within the theme folder ‘Enfold’ Navigate to config-templatebuilder » avia-template-builder » php »pointer.class.php
Replace the following code:
public function __construct( $pntrs = array() ) { // Don't run on WP < 3.3 if ( get_bloginfo( 'version' ) < '3.3' || !function_exists('get_current_screen')) return; $screen = get_current_screen(); $this->screen_id = $screen->id; $this->register_pointers($pntrs); add_action( 'admin_enqueue_scripts', array( &$this, 'add_pointers' ), 1000 ); add_action( 'admin_head', array( &$this, 'add_scripts' ) ); }
With the following –
Take Note: Theme Update
If you apply this fix, remember that when you update your theme, that all changes made to the pointer.class.php file will be lost.
public function __construct( $pntrs = array() ) { // Don't run on WP < 3.3 if ( get_bloginfo( 'version' ) < '3.3' || !function_exists('get_current_screen')) return; $screen = get_current_screen(); if(empty($screen)){ return; } $this->screen_id = $screen->id; $this->register_pointers($pntrs); add_action( 'admin_enqueue_scripts', array( &$this, 'add_pointers' ), 1000 ); add_action( 'admin_head', array( &$this, 'add_scripts' ) ); }