OnPoint Plugins

  • Plugins
    • Advanced Sidebar Menu
    • Go Live Update Urls
  • About
    • Services
    • Showcase
  • Blog
  • Contact
  • Support
  • Log In
← Back to support

Custom UL classes and disable menu box in pages/posts

Resolved

Requested: 4 years and 10 months ago

We just bought the Advances Sidebar Pro. So far all good, but I have two questions:
– How can we add own classes to the <ul> element of a menu? Filter?
– How can we disable the Advances Sidebar Menu Box in pages/posts?

Thanks

Plugin: Advanced Sidebar Menu

  1. bombelli

    4 years and 10 months ago

    Thanks a lot.
    Is there a way to define additionally where to show the menu.
    Let’s say on blog and specific archive pages only?

  2. OnPoint Plugins

    4 years and 10 months ago

    There are a number of plugins which allow you to show widgets on particular sections. Here are a couple examples (I am in no way affiliated with these other plugins and can not guarantee their functionality):

    https://wordpress.org/plugins/restrict-widgets/
    https://wordpress.org/plugins/widget-options/

    Otherwise if you would like to do this programmatically, you may update the previously sent filters to:

    add_filter( 'advanced-sidebar-menu/menus/category/is-displayed', '__return_true' );
    add_filter( 'advanced_sidebar_menu_category_ids', 'include_all_parent_terms', 1, 4 );
    function include_all_parent_terms( $term_ids, $args, $instance, $object ) {
    if ( 'category' !== $object->get_taxonomy() ) {
    return $term_ids;
    }

    //ADD CATEGORIES YOU WANT TO DISPLAY TO THIS ARRAY
    $categories = array( 'news' );

    if( is_page( 29 ) || is_category( $categories ) ) {
    return get_terms( array(
    'parent' => 0,
    'fields' => 'ids',
    'taxonomy' => 'category',
    'hide_empty' => true,
    ) );
    }

    return array();
    }

    This will display the widget on your blog page and whatever categories you add to the $categories array, marked with.
    //ADD CATEGORIES YOU WANT TO DISPLAY TO THIS ARRAY

  3. bombelli

    4 years and 10 months ago

    I have another question.
    When I open a single post page from a CPT, then the menu disappears.
    I checked the template and the sidebar is included.
    Any idea?

  4. OnPoint Plugins

    4 years and 10 months ago

    It appears you are using an “Advanced Menu” widget on the page. I am unfamiliar with that widget but I took a quick look anyway. I have confirmed that it is added to that sidebar and the options appear to be correct.

    Due to my lack of knowledge of this widget, I am unable to provide a solution. I recommend reaching out to the developer of the widget to see if they have a solution.

  5. bombelli

    4 years and 10 months ago

    Sorry!
    I confused the widgets!

    But thanks for looking into it!

« Older Responses

New Response Cancel reply

You must be logged in to respond. Only PRO members are allowed to respond to support requests.

© 2023 · WordPress Development · Terms Of Service · Privacy Policy · Cookie Policy · Log in

  • Plugins
  • Blog
  • Contact