Skip to:
Content
Pages
Categories
Search
Top
Bottom

Rearrange the order of SubNav items


  • Roland Fauster
    Participant

    @rfauster

    Hi

    I found the bp_core_sort_subnav_items() function in bp-core.php and thought this might be useful to change the order of the subnavs but I can’t figure out how to rearrange them!

    Has anybody done this already and cares to share?!

    Roland

Viewing 1 replies (of 1 total)

  • jivany
    Participant

    @jivany

    bp_core_sort_subnav_items() is added as an action to wp_head so you could create your own version in your theme’s functions.php file. You would then have to remove the existing action something like this:

    remove_action('wp_head', 'bp_core_sort_subnav_items', 1);
    add_action('wp_head', 'my_custom_sort_subnav_items', 1);

    In my_custom_sort_subnav_items() you could do whatever you wanted. Right now I think everything is sorted by the key name (the call to ksort).

    I guess the question is, how do you want them ordered? You might have to hardcode the order if it’s not something easily sorted. Or figure out how to modify the key names.

Viewing 1 replies (of 1 total)
  • The topic ‘Rearrange the order of SubNav items’ is closed to new replies.
Skip to toolbar