Hi,
I want to use this plugin to display a link to my “Rules” page on every group.
Is there a way to change the default, so that it always links to a specific page (rather than the site admin having to edit the group to change the linked page each time).
Many thanks
AlexHi Alex,
Thank you for the question.Please disable the plugin and use this code instead.
/** * Adds some page links to group nav. */ function buddydev_custo_add_pages_to_group_nav() { $group_id = bp_get_current_group_id(); if ( ! $group_id ) { return; } $page_ids = [ 1, 2, ]; // these are page ids. foreach ( $page_ids as $page_id ) { $post = get_post( $page_id ); if ( ! $post ) { continue; } echo '<li class="bp-linked-group-page"><a href="' . get_permalink( $post ) . '">' . get_the_title( $post ) . '</a></li>'; } } add_action( 'bp_group_options_nav', 'buddydev_custo_add_pages_to_group_nav' );
Please change the $page_ids with the actual page ids(one or more).
You can put this code in your theme’s functions.php or in wp-content/plugins/bp-custom.php or use it with any code snippet manager.
Regards
BrajeshPlease make sure that you have copied the code from this forum post and not from email reply.
Also, make sure that the page with the ids exist.Regards
Brajesh
The topic ‘ [Resolved] Plugin Help: Link Page to Groups’ is closed to new replies.