-
-
Save remkus/de9c0542a2fc925bdddf53a7ad098944 to your computer and use it in GitHub Desktop.
Make BuddyPress Members page obey its Page layout setting in Genesis. https://sridharkatakam.com/make-buddypress-members-page-obey-page-layout-setting-genesis/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Make BuddyPress Members page obey its Page layout setting | |
*/ | |
add_filter( 'genesis_pre_get_option_site_layout', 'sk_do_members_page_layout' ); | |
function sk_do_members_page_layout( $opt ) { | |
// if the current page is not the members directory, abort. | |
if ( ! bp_is_members_directory() ) { | |
return; | |
} | |
// get the list of BuddyPress pages from wp_options table | |
$page_array = get_option( 'bp-pages' ); | |
$opt = get_post_meta( $page_array['members'], '_genesis_layout', true ); // where $page_array['members'] is the ID of BuddyPress Members page | |
return $opt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment