[Support request] Ubermenu problem with Generatepress

Home Forums Support Ubermenu problem with Generatepress

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by Leo.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1227547
    Gelu-Dănuț

    Hello,

    I try to insert this code in Snipest to make Ubermenu work in Generatepress Theme:

    if ( ! function_exists( ‘generate_navigation_position’ ) ) {
    function generate_navigation_position(){
    if( function_exists( ‘ubermenu’ ) ){
    ubermenu( ‘main’ , array( ‘theme_location’ => ‘primary’ ) );
    }
    }
    }

    /* Stop the theme from filtering the menu output */
    add_action( ‘wp_head’ , ‘stop_generatepress_menu_filter’ );
    function stop_generatepress_menu_filter(){
    remove_filter( ‘walker_nav_menu_start_el’, ‘generate_nav_dropdown’, 10, 4 );
    }

    But i get this error:

    “The snippet has been deactivated due to an error on line 3:

    Cannot redeclare function generate_navigation_position.”

    Can you help me please?

    Advertoriale SEO in site-uri cu autoritate mare și foarte mare
    https://www.farcasgelu.eu

    #1227638
    Leo
    Staff
    Customer Support

    Hi there,

    Do you have any other functions that’s already using the generate_navigation_position function?

    Let me know 🙂

    #1227731
    Gelu-Dănuț

    I honestly don’t know where I can see if I have any other functions that’s already using the generate_navigation_position function. Can you help me with that? My site is https://dev.nmcromania.ro/.

    Advertoriale SEO in site-uri cu autoritate mare și foarte mare
    https://www.farcasgelu.eu

    #1227810
    Leo
    Staff
    Customer Support

    Ahh I think what’s the issue here.

    I believe that code needs to be added in child theme’s function.php (one of the rare case where Code Snippets wouldn’t work).

    Can you give that a shot?
    https://docs.generatepress.com/article/using-child-theme/#installing-a-child-theme
    https://docs.generatepress.com/article/adding-php/#use-a-child-theme

    Let me know 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.