This topic has 2 replies, 2 voices, and was last updated 8 years by pandreas82.
-
Author
Tagged: group, navigation, custom link
-
January 3, 2016 at 02:24 #96010pandreas82Participant
Hello all,
I have managed to add a custom link to group pages navigation menu in the last position. The link is to a certain category archive page.
Custom code is above (I have connected groups with a category, so the code somehow finds the term_id in order to be printed as the category link)COPY CODEfunction add_posts_category_to_group_nav() { if ( ! is_user_logged_in() ) { return; } if ( ! bp_is_group() ) { return; } /*Extra code to find term_id and category_link*/ $category_link = get_category_link($termid['term_id']); buddypress()->bp_options_nav[ $current_group_slug ][] = array( 'name' => 'Posts', 'link' => $category_link, 'slug' => 'posts', 'css_id' => 'posts', 'position' => 9999999, // last 'user_has_access' => true, ); } add_action( 'bp_setup_nav', 'add_posts_category_to_group_nav', 100 );
The question is how I will manage to show the output of custom link not to its page but under group info like the other menus of group navigation. For example “Members” option shows members of the group under the cover page and navagation menu of the group. Members as shown in the same page as group.
How can this be done in KLEO with custom link which is a wordpress page (/category/custom_slug)??
Thank you!
Andreas
January 4, 2016 at 19:22 #96217AndreiModeratorHi,
Unfortunately this is a much more complex task and will require advanced knowledge about the way the buddypress components work. If you are a developer I recommend you to do a research about the buddypress user and group navigations and screens.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 14, 2016 at 07:52 #144101pandreas82ParticipantI just noticed that bp_options_nav has been deprecated since version 2.6 of buddypress (https://buddypress.trac.wordpress.org/changeset/10745).
Can anyone explain to me the required changes to this specific code?
Thank you!
Regards,
Andreas
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.