Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › Nav Menu Roles and Dante Mega Menu's
New Landing › How can we help? › Themeforest Theme Support › Dante › Nav Menu Roles and Dante Mega Menu's
- This topic has 24 replies, 2 voices, and was last updated 8 years by David Martin – Support.
-
Posted in: Dante
-
February 1, 2016 at 8:30 pm #245506
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
February 2, 2016 at 4:23 pm #245768Hi Jeff,
When everything goes blank this indicates a PHP error. To help you debug this error please open the
wp-config.php
and change thisdefine('WP_DEBUG', false);
to thisdefine('WP_DEBUG', true);
.What is the error message that is output?
Thanks.
February 2, 2016 at 6:42 pm #245815This 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
February 2, 2016 at 6:59 pm #245817Ok, what code are you pasting in?
Thanks
February 2, 2016 at 7:19 pm #245830This 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
?>February 4, 2016 at 11:33 am #246340Have you added that code here
custom_walker.php
?Please attach the .php file here also.
Thanks.
February 4, 2016 at 12:11 pm #246361Yes. That’s the file.
I have attached the file.
February 4, 2016 at 12:12 pm #246363I 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.February 4, 2016 at 12:21 pm #246371Hi,
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.
February 4, 2016 at 12:26 pm #246372Where 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.February 4, 2016 at 12:46 pm #246387Ah! – Your theme is very dated, please test this build 3.2.3: https://www.dropbox.com/s/oqkxv93ju52kkxq/dante.zip?dl=0
Thanks.
February 4, 2016 at 1:10 pm #246411Thanks David! Updated it. Although still the same issue remains with menu’s. Do you know if I can place the code somewhere else?
February 4, 2016 at 1:52 pm #246424Hi,
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.
February 4, 2016 at 2:15 pm #246435DAVID! 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!
February 4, 2016 at 2:41 pm #246443Great, 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.
-
Posted in: Dante
You must be logged in and have valid license to reply to this topic.