{"id":631,"date":"2018-09-14T11:40:54","date_gmt":"2018-09-14T11:40:54","guid":{"rendered":"https:\/\/grooni.com\/docs\/groovy-menu\/?page_id=631"},"modified":"2023-03-21T23:13:31","modified_gmt":"2023-03-21T23:13:31","slug":"manual-integration","status":"publish","type":"page","link":"https:\/\/grooni.com\/docs\/groovy-menu\/integration\/manual-integration\/","title":{"rendered":"Manual Integration"},"content":{"rendered":"<p>Integration is the process of inserting the Groovy menu into your site.<\/p>\n<h2>PHP code<\/h2>\n<p>To manually integrate the Groovy menu into your theme, you&#8217;ll need to copy PHP code from the <code>Groovy menu &gt; Integration<\/code> section and paste it into the appropriate template in your theme.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-886\" src=\"https:\/\/grooni.com\/docs\/groovy-menu\/wp-content\/uploads\/sites\/3\/2019\/01\/screenshot-gm.local-2019.01.24-17-35-14.jpg\" alt=\"\" width=\"1499\" height=\"691\" srcset=\"https:\/\/grooni.com\/docs\/groovy-menu\/wp-content\/uploads\/sites\/3\/2019\/01\/screenshot-gm.local-2019.01.24-17-35-14.jpg 1499w, https:\/\/grooni.com\/docs\/groovy-menu\/wp-content\/uploads\/sites\/3\/2019\/01\/screenshot-gm.local-2019.01.24-17-35-14-300x138.jpg 300w, https:\/\/grooni.com\/docs\/groovy-menu\/wp-content\/uploads\/sites\/3\/2019\/01\/screenshot-gm.local-2019.01.24-17-35-14-768x354.jpg 768w, https:\/\/grooni.com\/docs\/groovy-menu\/wp-content\/uploads\/sites\/3\/2019\/01\/screenshot-gm.local-2019.01.24-17-35-14-1024x472.jpg 1024w\" sizes=\"(max-width: 1499px) 100vw, 1499px\" \/><\/p>\n<blockquote>\n<p>Note. Groovy menu creates its own menu location called&nbsp;<code>Groovy menu Primary<\/code> which can be found at <code>Appearance &gt; Menus &gt;&nbsp;Manage Locations<\/code><\/p>\n<\/blockquote>\n<h2>&nbsp;<\/h2>\n<h2>Header.php<\/h2>\n<p>The exact location in your theme&#8217;s code where th PHP code should be inserted will depend on your theme. However, the most common location is the <code>header.php<\/code><\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"alert alert-warning\">We recommend making such changes only in the child theme; otherwise, your changes will disappear after updating the theme.<\/div>\n<blockquote>\n<p>If you&#8217;re experiencing any issues during the integration process, please create a support ticket through <a href=\"https:\/\/grooni.ticksy.com\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Help desk<\/strong><\/a>.<\/p>\n<\/blockquote>\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n<h2>How to change wrapper tag<\/h2>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-1107\" src=\"https:\/\/grooni.com\/docs\/groovy-menu\/wp-content\/uploads\/sites\/3\/2019\/08\/gm-manual-integration-div-head.png\" alt=\"\" width=\"1595\" height=\"973\" srcset=\"https:\/\/grooni.com\/docs\/groovy-menu\/wp-content\/uploads\/sites\/3\/2019\/08\/gm-manual-integration-div-head.png 1595w, https:\/\/grooni.com\/docs\/groovy-menu\/wp-content\/uploads\/sites\/3\/2019\/08\/gm-manual-integration-div-head-300x183.png 300w, https:\/\/grooni.com\/docs\/groovy-menu\/wp-content\/uploads\/sites\/3\/2019\/08\/gm-manual-integration-div-head-768x469.png 768w, https:\/\/grooni.com\/docs\/groovy-menu\/wp-content\/uploads\/sites\/3\/2019\/08\/gm-manual-integration-div-head-1024x625.png 1024w\" sizes=\"(max-width: 1595px) 100vw, 1595px\" \/><\/p>\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<h2>How to manually integrate the Groovy Menu plugin into a child theme that is itself a child theme of another theme?<\/h2>\n\n\n\n<p>During manual integration of the Groovy Menu, we recommend using <strong>Child themes<\/strong> (<a href=\"https:\/\/codex.wordpress.org\/Child_Themes\">What is a child theme<\/a>). This will ensure that any changes you make are not lost when updating your WordPress theme.<\/p>\n\n\n\n<p>However, there may be situations where the Child theme is already being used as the main theme and is updated from the developer&#8217;s repository. Editing such a theme may result in loss of changes if the theme will be updated.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>If you are have installed such theme as <strong>Genesis<\/strong> or <strong>Primer<\/strong>, then you are already using a child theme.<\/p>\n\n\n\n<p>Editing such a theme may result in loss of changes if the theme is ever updated.<\/p>\n\n\n\n<p>In such cases, instead of editing a child theme, you can create a <strong>Grandchild<\/strong> theme.<\/p>\n\n\n\n<p>This is similar to creating a child theme, except that you do it through a specail plugin. You can add your custom functions to the plugin, just as you would in functions.php (although it&#8217;s important to note that your plugin will be called much earlier than functions.php, so any code in your plugin should only execute when the corresponding action is being executed).<\/p>\n\n\n\n<p>Bellow we provide example of such plugin.<\/p>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<h3> Integration mega menu trough a plugin<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );\n\/*\nPlugin Name: Grandchild Theme\nPlugin URI: https:\/\/groovymenu.grooni.com\/\nDescription: A WordPress Grandchild Theme (as a plugin).\nAuthor: Grooni\nVersion: 1.0.0\nAuthor URI: https:\/\/groovymenu.grooni.com\/\n*\/\n\/\/ This action is execute when the template redirects and all functions and actions of the template are loaded.\nadd_action( 'template_redirect', 'gts_grooni_remove_and_add_action', 99 );\nfunction gts_grooni_remove_and_add_action() {\n    \/\/ This is an example!!!  Remove the header action from the parent theme Primer\n    remove_action( 'primer_header', 'primer_add_primary_navigation', 11 );\n    \/\/ This is an example!!!  Add Groovy Menu instead primary_navigation\n    add_action( 'primer_header', 'gts_grooni_add_to_primary_navigation', 11 );\n}\nfunction gts_grooni_add_to_primary_navigation() {\n    if ( function_exists( 'groovy_menu' ) ) {\n        groovy_menu();\n    }\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<h3>Integration through shortcode<\/h3>\n\n\n<div tabindex=\"0\" role=\"button\" aria-label=\"\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0432\u0432\u043e\u0434\" data-tooltip-align=\"t,c\" aria-pressed=\"false\" aria-disabled=\"false\" data-tooltip=\"\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0432\u0432\u043e\u0434\">You can use the <code>[groovy_menu]<\/code> shortcode to output the Groovy Menu. Simply paste the shortcode where you would like the menu to appear.<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Integration is the process of inserting the Groovy menu into your site. PHP code To manually integrate the Groovy menu &hellip; <a href=\"https:\/\/grooni.com\/docs\/groovy-menu\/integration\/manual-integration\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":627,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/pages\/631"}],"collection":[{"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/comments?post=631"}],"version-history":[{"count":4,"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/pages\/631\/revisions"}],"predecessor-version":[{"id":2729,"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/pages\/631\/revisions\/2729"}],"up":[{"embeddable":true,"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/pages\/627"}],"wp:attachment":[{"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/media?parent=631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}