Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1279792

    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.

    • This topic was modified 3 years, 9 months ago by alexosd.
    #1280286

    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

    #1327693

    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

    #1327773

    Hi,

    Please consider using a plugin such as this one – https://wordpress.org/plugins/shortcode-in-menus/

    Best regards,
    Yigit

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