{"id":2117,"date":"2021-01-15T13:41:28","date_gmt":"2021-01-15T13:41:28","guid":{"rendered":"https:\/\/grooni.com\/docs\/groovy-menu\/?page_id=2117"},"modified":"2021-01-15T13:42:30","modified_gmt":"2021-01-15T13:42:30","slug":"flatsome","status":"publish","type":"page","link":"https:\/\/grooni.com\/docs\/groovy-menu\/theme-integration\/flatsome\/","title":{"rendered":"Flatsome"},"content":{"rendered":"<p>Add this code into <code>function.php<\/code> of your <a href=\"https:\/\/developer.wordpress.org\/themes\/advanced-topics\/child-themes\/\">child theme<\/a>.<\/p>\n<blockquote>\n<p>Please make all changes to the child theme files, and do not add the code directly to the theme files, otherwise after updating the theme your fixes will be lost<\/p>\n<\/blockquote>\n<p><code>function.php<\/code><\/p>\n<pre><code>\/\/ Add Groovy Menu integration function.\nif ( ! function_exists( 'gm_custom_flatsome_child_theme_integration' ) ) {\n\n\tadd_action( 'flatsome_after_body_open', 'gm_custom_flatsome_child_theme_integration', 5 );\n\n\tfunction gm_custom_flatsome_child_theme_integration() {\n\t\tif ( function_exists( 'groovy_menu' ) ) {\n\n\t\t\tadd_action( 'flatsome_before_header', 'gm_custom_flatsome_child_theme_integration__start_cache', 0 );\n\t\t\tadd_action( 'flatsome_after_header',  'gm_custom_flatsome_child_theme_integration__clear_cache', 99999 );\n\n\t\t\tgroovy_menu();\n\t\t}\n\t}\n\n\tif ( ! function_exists( 'gm_custom_flatsome_child_theme_integration__start_cache' ) ) {\n\t\tfunction gm_custom_flatsome_child_theme_integration__start_cache() {\n\t\t\tob_start();\n\t\t}\n\t}\n\n\tif ( ! function_exists( 'gm_custom_flatsome_child_theme_integration__clear_cache' ) ) {\n\t\tfunction gm_custom_flatsome_child_theme_integration__clear_cache() {\n\t\t\tob_get_clean();\n\t\t}\n\t}\n}\n<\/code><\/pre>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"alert alert-warning\"><strong>Note:<\/strong> You can find the child theme for the Flatsome theme in the <code>Groovy Menu &gt; Integration section<\/code><\/div>","protected":false},"excerpt":{"rendered":"<p>Add this code into function.php of your child theme. Please make all changes to the child theme files, and do &hellip; <a href=\"https:\/\/grooni.com\/docs\/groovy-menu\/theme-integration\/flatsome\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":2075,"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\/2117"}],"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\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/comments?post=2117"}],"version-history":[{"count":0,"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/pages\/2117\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/pages\/2075"}],"wp:attachment":[{"href":"https:\/\/grooni.com\/docs\/groovy-menu\/wp-json\/wp\/v2\/media?parent=2117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}