Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Support: Creating & Extending

Existing and new plugins/components and themes.

Bp Drop Down menus – help correct css (7 posts)

Started 1 year ago by: nit3watch

  • Profile picture of nit3watch nit3watch said 1 year ago:

    Using Modemloopers BuddyPress drop downs now, when you select a page other than ‘home’, it doesn’t show that it has been selected. There seems to be no rule for ul#nav li:selected a.

    I have tried playing around with the css though haven’t found a solution. I need this for a current prodject along with my BuddyPress UX theme for the community.

    Help would be greatly appreciated! I have asked Modemlooper though he seems to be pre-occupied :<

  • Profile picture of Hugo Hugo said 1 year ago:

    Insufficient information for a meaningful response :)

    Are you saying that a class selected is not applied to the markup? or simply that there are no rulesets to apply any styling to that class.

  • Profile picture of Hugo Hugo said 1 year ago:

    Also I would suggest that this is possibly somewhat redundant code? dropdown menus are available either with wp_nav_menu or the fallback wp_list_pages

  • Profile picture of nit3watch nit3watch said 1 year ago:

    @hnla basically I want the ability to replace the buddypress main nav with wordpress menus: via Appearance > Menus.

    Being able to have a custom menu like:
    Home
    Community
    -Activity
    -Members
    Groups

    What would be the best way to implement this?

  • Profile picture of Hugo Hugo said 1 year ago:

    What versions are you building for? Personally I would not be building layouts based on earlier versions If you were building from bp trunk then the menu is now changed to use wp_nav_menu with a fallback if the user has not implemented custom menus in the dashboard to using wp_list_pages controlled from bp-default functions.php

    If you need or want to use the older style bp header menu then you could wrap the links in an if is wp_nav_menu then display wp_nav_menu else display older BP nav links but I’m not sure there’s a point to that.

  • Profile picture of nit3watch nit3watch said 1 year ago:

    Thanks hnla Ill give it a go.

    The theme im working on is from bp 1.2.8

  • Profile picture of Hugo Hugo said 1 year ago:

    You can wrap in something like:

    <?php if( has_nav_menu('primary_main_links') ) : ?>
      <?php wp_nav_menu( array('lots of parameter stuff here') ) ?>
    <?php else: ?>
       'other menu stuff here'
    
    <?php endif; ?>

    has_nav_menu() looks to see if a menu has been assigned by an admin to a menu region configured by yourself and if so will display it.

    Or equally you could use the fallback parameter in the wp_nav_menu array to access a function and place all the older menu stuff in that within functions.php?