How to make to hide floating menu on some pages?

Tutorial 4 posts from 3 participants
  • Started 4 years, 8 months ago ago by Steve L.
  • Replied 4 years, 2 months ago ago by Chris S.
Viewing 5 posts - 1 through 5 (of 5 total)
  • #2350

    Steve L.

    Hello.

    I want to hide floating menu on some pages?

    I think there is some way to hide with current url or some other ways (pages or portfolio).

    Please let me know how to do it.

    Thank you for your support.

    #2353

    Constantin

    Yes, you can do this by hooking to a filter implemented by the plugin and using function is_page().

    The code below should be placed into your WordPress theme functions.php file:

    
    /**
     * Remove CodeFlavors menu for page ID 2
     * @param boolean $show - show (true) or hide (false) the menu
     * @return boolean
     */
    function remove_from_pages( $show ){
        if( is_page( 2 ) ){
            return false;
        }
        
        return $show;
    }
    add_filter( 'cfm_show_menu', 'remove_from_pages' );
    

    For multiple pages, use is_page() with the array parameter (see examples in WordPress Codex).

    #2357

    Steve L.

    Hello.

    I applied your code as following.

    function remove_from_pages( $show ){
    if( is_page( 712 ) ){
    return $show;
    }else{
    return false;
    }
    }
    add_filter( ‘cfm_show_menu’, ‘remove_from_pages’ );

    The issue is floating menu is showing up sometimes.
    It is not working properly.

    The following url is page_id = 712

    http://danamoob2b.cafe24.com/collection/

    Please click other menu and back to collection.

    You can see floating side bar is not showing on collection page sometimes.

    Please check the code again for me.

    Thank you for your help.

    #2358

    Constantin

    Hi,

    The code is correct, it will show the menu when on page ID 712. The problem might be with your theme, I noticed that when you navigate from the top menu, the floating menu isn’t displayed but if you go to Collections from Home and refresh the page, the menu appears. My best guess is that your theme or some script is preventing the menu from being displayed.

    One thing you could try is to switch to a default WP theme (Twenty Sixteen for example) and see if the same is happening.

    #2458

    Chris S.

    I SOLVED IT!
    Ok! You have to use TWO plugins.

    1) Install this one, and then install “Per Page Custom Menus and Featured Posts IntelliWidget”.

    2) In wordpress, go to Appearance > Menus.

    3) Under ‘Manage Locations’, make sure to not select a default menu for the ‘CodeFlavors Floating Menu’. It will stay blank and not display ANYTHING no matter what page you are on.

    4) Now we control what menu you use for the ‘CodeFlavors Floating Menu’ on each page that we want to use this floating menu. Thus, on each page you want to use their floating menu, you will just select to override it with a different menu that you created.

    5) On the page/post you want to use the menu, you see the section for ‘IntelliWidget Profiles’. Use these settings.

    Use Profiles From: This Form
    Click “Add New Profile”
    Check Override Check Box
    Parent: Unassigned
    In “General Settings” …
    -> IntelliWidget Type: Nav Menu
    -> Everything else can be blank
    Menu Location: /*select the menu you want to use. You created it in Appearance > Menu”*/
    Click “save Settings”

    Click Update on your page/post.

    BOOM!!!! Got ya figured out!
    I use this to have a floating menu, where the menu references anchors on the page so people can just jump to the anchors constantly.

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

You must be logged in to reply to this topic.