Celebrating 7 Years! Get up to $30 off GeneratePress Premium!

[Support request] trouble integrating UberMenu 3 from sevenspark

Home Forums Support [Support request] trouble integrating UberMenu 3 from sevenspark

Home Forums Support trouble integrating UberMenu 3 from sevenspark

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #489912
    drew

    I’ve been trying to integrate the ubermenu 3 plugin from Sevenspark per their integration guide here: http://sevenspark.com/docs/ubermenu-3/theme-integration/generatepress

    I’ve discovered that attempts to insert the necessary functions via code snippets plugin is throwing errors. According to the devs at sevenspark, it requires using a child theme in order to override the pluggable function.

    I’m not excited about the idea of creating a child theme expressly for using a single plugin and am wondering if you have any other suggestions on how to go about using those functions (perhaps working them in as a hook?).

    Many thanks,
    Drew

    GeneratePress 2.0.2
    GP Premium 1.5.6
    #490105
    Tom
    Lead Developer
    Lead Developer

    What are the errors you’re encountering?

    #490452
    Simon

    You really should be using a child theme, it bring other benefits too, like making customizations that survive a theme update.

    You can place the following in your child theme ‘functions.php’. You may or may not need the inner ‘div’, I use it to allow a full width menu bar, but contain the menu items to the ‘contained width’ of the site:

    /* Replace GeneratePress's main navigation menu with UberMenu */
    function generate_navigation_position() {
      if (function_exists('ubermenu')) {
        echo '<div class="ubernav-container">';
        echo '<div class="grid-container">';
        ubermenu('main' , array('theme_location' => 'primary'));
        echo '</div>';
        echo '</div>';
      }
    }
    #490462
    drew

    The error message is:

    Cannot redeclare generate_navigation_position() (previously declared in
    /nas/content/staging/morikami/wp-content/themes/generatepress/inc/structure/navigation.php:20)

    …and according to the plugin dev “you need to add the code in a child theme in order to override the pluggable function.”

    I really want to avoid using a child theme, that was one of the primary features of using GP to begin with. Adding one now only erases part of the customizations already added so that only makes another tedious step of comparing each settings panel in the customizer to look for changes.

    #490477
    Simon

    You might be able to put it in GP’s own functions.php, but it WILL be wiped out by a theme update.

    #490480
    drew

    Many thanks Simon, I’m well versed on all of that. What I’m looking for from Tom is to hopefully find a different solution.

    #490698
    Tom
    Lead Developer
    Lead Developer

    Their code in the docs isn’t correct.

    It should be:

    if ( ! function_exists( 'generate_navigation_position' ) ) {
        function generate_navigation_position() {
            if( function_exists( 'ubermenu' ) ){
                ubermenu( 'main' , array( 'theme_location' => 'primary' ) );
            }
        }
    }
    #490711
    drew

    Gotcha and to confirm, using this in the snippet plugin should work, correct?

    #490807
    Leo
    Staff
    Customer Support
    #490809
    drew

    Awesome, I will do that on my end plus forward this along to the ubermenu dev – thanks guys!

    #490918
    Leo
    Staff
    Customer Support

    Glad we could help 🙂

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