I have the same question. Does WP checks if a template file loading already has a `get_header` and `get_footer`? and if so will ignore the header and footer loaded from the parent file? it is really confusing.
drrxa: no, if you call those functions twice, the content will be duplicated.
Thanks for reply Paul. And yes, WP won’t check for that and if called twice there will be double headers and footers.
What I have found that these settings files (located in `bp-themes/bp-default/members/single/settings/`) are not loaded by the file `members/single/settings.php` and that is maybe why they override the original layout (they have for example their own `get_header, get_footer`, and `get_sidebar`). I found that by commenting the block of code responsible for loading these files in `settings.php` file which is:
`
<?php
/*
if ( bp_is_current_action( ‘notifications’ ) ) :
locate_template( array( ‘members/single/settings/notifications.php’ ), true );
elseif ( bp_is_current_action( ‘delete-account’ ) ) :
locate_template( array( ‘members/single/settings/delete-account.php’ ), true );
elseif ( bp_is_current_action( ‘general’ ) ) :
locate_template( array( ‘members/single/settings/general.php’ ), true );
else :
locate_template( array( ‘members/single/plugins.php’ ), true );
endif;
*/
?>
`
And the file still loading correctly, while doing the same thing in `members/single/profile.php` will break the theme loading.
I dont have specific need for that, but I am just curious about where these files are loaded from and why they dont follow the same procedure? I have made a custom header for logged-in users `get_heade(‘loggedin’)` and rather than only modifying the `home.php` file header only, I had to modify the header of these four settings files as well `capabilities.php, delete-account.php, general.php, notifications.php`.
Thanks r-a-y, I understand now.