Sorry, I gotta ask. I need to put a simple shortcode as a menu item or subitem.
Usually, I use the “Shortcodes in Menu” plugin, but with Enfold it doesn’t work, it’s blank.
I tried activating the widget area and adding the shortcode as text,
I tried:
add_filter( ‘wp_nav_menu_items’, ‘my_custom_menu_item’, 10, 2 );
function my_custom_menu_item ( $items, $args )
{
$items .= ‘<li class=”menu-item custom-menu-item”>[mycred_my_balance] Points<ul class=”sub-menu”><li class=”menu-item menu-item-type-post_type menu-item-object-page”>’.do_shortcode(“[mycred_my_balance]”).’‘;
return $items;
}
And I tried:
function mycred_balance(){
echo “<div class=’g-trans’>”.do_shortcode(‘[mycred_my_balance]’).”</div>”;
}
add_action(‘avia_meta_header’, ‘mycred_balance’, 10);
Nada. Zilch. Zero.
Hey alexosd,
There is a new option in Enfold -> Theme Options -> Preprocessing Shortcodes In Header.
Select “allow to process”.
And as a first step also in Enfold -> Preformance disable Enfold compression of js and css files and
“Disabling of template builder elements” select always load all elements.
Best regards,
Victoria
Hi,
I have tried to put a shortcode as submenu item from a third party plugin, but it does not work.
I followed up the steps Victoria explained but I do not know exactly what I have to do that it works.
Can you help please
best regards
tbp
Hi,
Please consider using a plugin such as this one – https://wordpress.org/plugins/shortcode-in-menus/
Best regards,
Yigit