[Support request] Displaying Menu Descriptions

Home Forums Support [Support request] Displaying Menu Descriptions

Home Forums Support Displaying Menu Descriptions

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #356439
    Greg

    Hello,
    I am trying to display menu descriptions.
    I know I have must have done something wrong on this site: Menu descriptions under the Services menu item.
    Because on this site they display properly: Please hover over the about menu item

    Could you tell me where I have gone wrong.

    I have this PHP snippet in each function.php to allow html in the description entity.

    remove_filter( 'nav_menu_description', 'strip_tags' );
    add_filter( 'wp_setup_nav_menu_item', 'ipcf_wp_setup_nav_menu_item' );
    function ipcf_wp_setup_nav_menu_item( $menuItem ) {
        if ( isset( $menuItem->post_type ) && 'nav_menu_item' == $menuItem->post_type ) {
            $menuItem->description = apply_filters( 'nav_menu_description', $menuItem->post_content );
        }
        return $menuItem;
    }

    Any insight would be great, as I think I have been looking to long at this.
    Cheers
    Greg

    #356520
    Tom
    Lead Developer
    Lead Developer

    I’m not sure I understand – that looks like a mega menu plugin?

    Are you not wanting the first site mega menu to be full width?

    #356627
    Greg

    Hello Tom,
    sorry if I was unclear.

    Yes, it is a mega-menu, but not a plugin. In-fact its your mega-menu css markup that I am using.

    On my test site the menu descriptions are being displayed in roughly the way I want them. On my client side site they are not. Exactly the same markup is being used in both.

    I cannot seem to discern why the descriptions are showing up in the test site and not in the client site.

    I am quite sure I have done something idiotic but I can’t find the problem.

    Hope that clears up any confusion, if not let me know. The only difference in the menu setup is I have set the mega-submenu to be fullwidth in the client site.

    On both sites I am using the plugin menu image to insert the icons. So that can’t be the conflict. Both sites are using GP Premium and Elementor PRO.

    Cheers
    Greg

    #356936
    Tom
    Lead Developer
    Lead Developer

    The above function is the only menu-related function you have?

    The description field allows you to input a description on both sites?

    #357048
    Greg

    Yes, the above function is the only menu related function I have.

    I have entered the same content in the menu description field on the both sites. On one site, the test one, the descriptions are being output, on the other, the client site; the description are not being output. If you connect to the test site and hover over the About menu item, you will see the mega-menu expand and display the content from the description field. If you connect to the client site and hover over the About menu item you will see the mega-menu expand and no content from the description field is being output. So my question is why the difference in the two sites. I am either missing something in what you are saying or I am not explaining the problem clearly enough. I have added a couple of photos of the problem.

    This is how the menu looks on the test site.
    Menu Image with descriptions showing

    and this is how it looks on the client site
    Menu Image with descriptions NOT showing

    I know I have done some to cause this, but I don’t know what!

    Thanks for your continued support.

    Cheers
    Greg

    #357166
    Tom
    Lead Developer
    Lead Developer

    I’m afraid it’s super hard for me to tell without being able to inspect the code of each page through the Dashboard.

    One method would be to try and make it so the original site doesn’t display the descriptions. This might help you see what the problem site is missing.

    #357174
    Greg

    Hello Tom,
    Thx for looking – I will try your suggestion. I have very little hair left to pull out at this point! But whats a few more tufts here and there. If I cannot suss it out by tomorrow morning, I will send along the credentials so you can work your magic.

    Thanks for creating such a great theme. it really is fabulous to work with.

    Cheers
    Greg

    #357301
    Tom
    Lead Developer
    Lead Developer

    No problem – hopefully breaking it on the other site will show us why it isn’t working 🙂

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