GeneratePress Integration

GeneratePress is an amazing theme that is really flexible but there is a few things that need to be changed so existing styles do not override the plugins and extraneous widgets are removed so Pixelmenu can work at full capacity.

How to integrate Pixelmenu with GeneratePress

It’s bad practice to edit the core files of any theme or plugin that you download. Everytime you update, your changes will be erased and you will have to start again. To get around this, WordPress uses child themes. GeneratePress has kindly provided a child theme for users to implement.

1. Download Generate Press Child Theme, Install and Activate

http://generatepress.com/api/themes/generatepress_child.zip

2. Override GeneratePress Navigation Bar

Go to the child themes functions.php file and place the following code at the bottom:


/* Overide the theme's menu with Pixelmenu */
function generate_navigation_position(){
wp_nav_menu( array( 'theme_location' => 'primary' ) );
}

/* Stop the theme from changing the menu output */
add_action( 'wp_head' , 'pb_halt_generatepress_menu_filter' );
function pb_halt_generatepress_menu_filter(){
remove_filter( 'walker_nav_menu_start_el', 'generate_nav_dropdown', 10, 4 );
}

The above code will stop GeneratePress overwriting the navigation output and allow Pixelmenu to work freely, there is just one more step that needs to be completed.

3.Make Pixelmenu Obey the Site Width

After you have completed step two, the menu will be full width, to make it obey the themes existing container width you need to make one adjustment.

Go to: WP-admin > customize > Pixelmenu > Primary > Navbar > General

You will see an option field called Container Class. You will need to enter the following text in the box and hit save: grid-container

Pixelmenu will now be fully integrated and working with GeneratePress.

0 People Found This Helpful.

Viewed 324 times.