New Landing How can we help? Themeforest Theme Support Dante Nav Menu Roles and Dante Mega Menu's

Viewing 15 posts - 1 through 15 (of 25 total)
  • Posted in: Dante
  • #245506
    MovieRebels
    Member
    Post count: 24

    Hi Swiftideas,

    I am struggling with the Nav Menu Roles plugin to get it working with the Dante Swift Thema because the same core hook is used already by Mega Menu’s. Now I have searched this forum and looked at all of the answers but I could not get it to work for me. I noticed that you guys incorporated it in the Atelier theme (http://www.swiftideas.com/forums/topic/nav-menu-roles/).

    This is the workaround:

    “Workaround #1
    Shazdeh, the author of Menu Item Visibility Control plugin had the genius idea to not wait for a core hook and simply add the hook ourselves. If all plugin and theme authors use the same hook, we can make our plugins play together.

    Therefore, as of version 1.6 I am modifying my admin walker to only adding the following line (right after the description input):

    <?php
    // This is the added section
    do_action( ‘wp_nav_menu_item_custom_fields’, $item_id, $item, $depth, $args );
    // end added section
    ?>

    Although in another topic of the Dante theme you mentioned that this is beyond the scope of the support. You did try to point in the right direction by mentioning that it should be placed in the following file:

    Inside the file custom_walker.php located at dante/swift-framework/sf-megamenu/

    Maybe I am placing it at the wrong place. But when I save the file the entire site goes blank.

    Do you know where exactly I need to place it for the theme to work? Any help would be really appreciated. I have been stuck and trying to fix it for a few days now with no hope…

    Thanks!

    Jeff

    #245768
    David Martin – Support
    Moderator
    Post count: 20834

    Hi Jeff,

    When everything goes blank this indicates a PHP error. To help you debug this error please open the wp-config.php and change this define('WP_DEBUG', false); to this define('WP_DEBUG', true);.

    What is the error message that is output?

    Thanks.

    #245815
    MovieRebels
    Member
    Post count: 24

    This is the error message:

    Parse error: syntax error, unexpected ‘<‘ in /var/www/qb210446/data/www/salsaventura.tv/wp-content/themes/dante/swift-framework/sf-megamenu/custom_walker.php on line 14

    #245817
    David Martin – Support
    Moderator
    Post count: 20834

    Ok, what code are you pasting in?

    Thanks

    #245830
    MovieRebels
    Member
    Post count: 24

    This is de code:

    <p class=”field-description description description-wide”>
    <label for=”edit-menu-item-description-<?php echo $item_id; ?>”>
    <?php _e( ‘Description’ ); ?><br />
    <textarea id=”edit-menu-item-description-<?php echo $item_id; ?>” class=”widefat edit-menu-item-description” rows=”3″ cols=”20″ name=”menu-item-description[<?php echo $item_id; ?>]”><?php echo esc_html( $item->description ); // textarea_escaped ?></textarea>
    <span class=”description”><?php _e(‘The description will be displayed in the menu if the current theme supports it.’); ?></span>
    </label>
    </p>

    <?php
    // Add this directly after the description paragraph in the start_el() method
    do_action( ‘wp_nav_menu_item_custom_fields’, $item_id, $item, $depth, $args );
    // end added section
    ?>

    #246340
    David Martin – Support
    Moderator
    Post count: 20834

    Have you added that code here custom_walker.php?

    Please attach the .php file here also.

    Thanks.

    #246361
    MovieRebels
    Member
    Post count: 24

    Yes. That’s the file.

    I have attached the file.

    #246363
    MovieRebels
    Member
    Post count: 24

    I noticed that php files are not supported for security reasons. Now attached as zip file.

    Attachments:
    You must be logged in to view attached files.
    #246371
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Do not place the code there it will never work in it’s current format.

    Are you certainly using the latest theme version, Ed mentioned this had been integrated already http://www.swiftideas.com/forums/topic/nav-menu-roles/#post-175360.

    Thanks.

    #246372
    MovieRebels
    Member
    Post count: 24

    Where should I place it?

    There is no update available. I’m using theme 2.65.
    I am using another theme then Ed is talking about. He is referring to the Atelier theme. I am using Dante.

    #246387
    David Martin – Support
    Moderator
    Post count: 20834

    Ah! – Your theme is very dated, please test this build 3.2.3: https://www.dropbox.com/s/oqkxv93ju52kkxq/dante.zip?dl=0

    Thanks.

    #246411
    MovieRebels
    Member
    Post count: 24

    Thanks David! Updated it. Although still the same issue remains with menu’s. Do you know if I can place the code somewhere else?

    #246424
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Sure Step 1, open /themes/dante/swift-framework/sf-megamenu/sf-megamenu.php:

    You will see this on line 23-24:

    `// add custom menu fields to menu
    add_filter( ‘wp_setup_nav_menu_item’, array( $this, ‘sf_mega_menu_add_custom_nav_fields’ ) );`


    Amend that to this:

    // add new fields via hook
    			add_action( 'wp_nav_menu_item_custom_fields', array( $this, 'sf_mega_menu_add_custom_fields' ), 10, 5 );
    
    // add custom menu fields to menu
    			add_filter( 'wp_setup_nav_menu_item', array( $this, 'sf_mega_menu_add_custom_nav_fields' ) );

    Step 2

    Open /themes/dante/swift-framework/sf-megamenu/edit_custom_walker.php.

    Locate line 275:

    	            <?php
    	            /* New fields insertion ends here */
    	            ?>

    Change that to this:

                <?php 
    	            // This is the added section
    	            do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args );
    	            // end added section 
                ?>
                
                <?php
                    /* New fields insertion ends here */
                ?>

    Thanks.

    #246435
    MovieRebels
    Member
    Post count: 24

    DAVID! You are a GENIUS! Thank you so much. Really appreciate it. This worked.
    One last question. Since I updated to the last version of Dante. Suddenly every page that got a shortcode from the plugin Vimeography on it, doesn’t work anymore. The page is blank except the menu. But even de wordpress toolbar doesn’t show any links anymore. I have already contacted the creator of the plugin although maybe this is something that you have experienced before after upgrading.

    Thanks again!

    #246443
    David Martin – Support
    Moderator
    Post count: 20834

    Great, no problem – glad that helped you.

    Unfortunately I am not sure regarding the plugin, is it updated also along with WP core? Best to contact the plugin author and they will help you.

    Thanks.

Viewing 15 posts - 1 through 15 (of 25 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register