Integration is the process of inserting the Groovy menu into your site.

Generating code for manual integration

To manually integrate Groovy menu into your theme, you need to copy the generated PHP code from the Groovy menu > Integration page and paste it into the appropriate template in your theme.

Note. Groovy menu creates its own menu location called Groovy menu Primary which can be found at Appearance > Menus > Manage Locations

Pasting the generated code into the theme

The place where the code should be inserted depends on the theme. The most common place is the header.php.

We recommend that you make such changes only in the child theme, otherwise your changes will disappear after updating the theme.

If you experiencing troubles with integration process please create a ticket through our Support portal.

How to Change Wrapper HTML Tag

How to integrate manually into a theme that is a child theme?

During manual integration of the Groovy Menu, we recommend using Child themes (https://codex.wordpress.org/Child_Themes). This will embed the Groovy Menu in the right place in the theme. And these changes will not lost after updating your WordPress theme.

However, there are situations when the Child theme is already used as the main theme and which is updated from the repository from the developer of this theme.

If you are working with a Framework such as Genesis or Primer, then most likely you are already using a child theme.

Editing such a theme may result in loss of changes if the theme is ever updated.

In this case, instead of editing a child theme, you can create a Grandchild theme.

This is very similar to creating a child theme, except that you do it through a plugin. You add your custom functions to the plugin, as you usually do in functions.php (although remember that your plugin will be called much earlier than functions.php, so you need to make sure that any code in your plugin only works when action is being executed).

Below is an example code of such a plugin:

<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
/*
Plugin Name: Grandchild Theme
Plugin URI: https://groovymenu.grooni.com/
Description: A WordPress Grandchild Theme (as a plugin).
Author: Grooni
Version: 1.0.0
Author URI: https://groovymenu.grooni.com/
*/
// This action is execute when the template redirects and all functions and actions of the template are loaded.
add_action( 'template_redirect', 'gts_grooni_remove_and_add_action', 99 );
function gts_grooni_remove_and_add_action() {
    // This is an example!!!  Remove the header action from the parent theme Primer
    remove_action( 'primer_header', 'primer_add_primary_navigation', 11 );
    // This is an example!!!  Add Groovy Menu instead primary_navigation
    add_action( 'primer_header', 'gts_grooni_add_to_primary_navigation', 11 );
}
function gts_grooni_add_to_primary_navigation() {
    if ( function_exists( 'groovy_menu' ) ) {
        groovy_menu();
    }
}