Adding New Message to Mobile Menu


Home Forums Front End PM PRO Adding New Message to Mobile Menu

This topic is: Not Resolved

This topic contains 4 replies, has 2 voices, and was last updated by  Chris M 2 days, 22 hours ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #24561

    Chris M
    Participant

    Hello Sharmin,
    So here is a bit of a tricky one. I would like to add the new message count to my nav menu. I saw your instructions and I’m avoiding the “do shortcode” because I have a large site and like you said, it’s resource intensive.

    So I did it using the php method and it worked just fine, but only on desktop versions. On a desktop it added the menu option “Messages Box” to the end of the list and displayed the new message count, so all fine there. But on my iphone, “Messages Box” isn’t displayed at all and neither is a count.

    Any ideas?
    Thanks

    #24594

    shamim
    Keymaster

    Some theme use separate menu for mobile. Please ask your theme developers how to add menu item for mobile, is there any separate hook or theme_location?

    Let me know so that a can assist you to add this if require.

    #24654

    Chris M
    Participant

    Ok, so here is the situation, and not sure you’ll be able to help but still wanted to ask.

    So the theme has set a mobile menu but I really don’t like it, so I’m using a plugin called Responsive Menu which works great for creating responsive menus on all the mobile devices. And being a little clever, I just created a completely new menu in the Appearance>>Menu area and just didn’t assign it a location. That menu is working perfectly with the Responsive Menu plugin. Because of this setup, I have the menu ID number for the menu, but don’t have a theme_location as this is separate from the theme.

    Is it possible to to use a menu ID instead of theme_location?
    Thanks

    #24691

    shamim
    Keymaster

    If we know menu slug then we can use that. use like following (change MENU_SLUG with your menu slug)

    add_filter( 'wp_nav_menu_MENU_SLUG_items', function( $items, $args ) {
        $items .= '<li><a href="'. fep_query_url( 'messagebox' ) .'">' . sprintf(__('Message Box%s', 'front-end-pm'), fep_get_new_message_button() ) . '</a></li>';
        return $items;
    }, 99, 2);
    
    #24702

    Chris M
    Participant

    Thanks, for the speedy reply. I’ll give it a try.

Viewing 5 posts - 1 through 5 (of 5 total)

You need to purchase ‘Front End PM PRO’ to reply in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.