i can report that, the remove action in “init” are not working, taken too far in the process i suppose, but they are not working. btw, wouldn’t it be more logical to move that action to a wp_head or something?
I’ve got the same problem trying to remove the custom header image.
All the other actions I’m removing works ok.
Report this as a bug on https://trac.buddypress.org/, I think init is too early.
Works perfectly fine for me.
I have a empty function.php in my child’s theme, however, it has that one line:
<?php remove_action( ‘init’, ‘bp_dtheme_add_custom_header_support’ ); ?>
Make sure there isn’t any other function that may override the bp-defaults.
If that doesn’t work, you can attempt to copy the function and replacing the the few lines with a return call.
Erm Scratch what I just said. After going to the latest RC from a “Fresh Install”
I can confirm that this init is no longer working as well.
File a bug for this please, it was working before so something must have happened.
thanks for the response guys:)
i see previous trac log had this
Allow child themes to completely remove custom image header settings in bp-default by using remove_action( 'template_redirect', 'bp_dtheme_add_custom_header_support' ); in their functions.php file.
maybe the remove_action() on this work…
haven’t tried it yet.
I tried it. Doesn’t work.
A temporary quick fix would be to add the following to your child theme’s CSS:
If you don’t want any image:
#header { background: none !important }
If you want some other image:
#header { background: url(/path/to/image.gif) !important }
Ah yes… the good old “!Important” keyword :o)
Just a quick thought (I don’t know the answer):
Is it an order of ‘inclusion’ issue with the functions.php files?
i.e. does the parent (bp-default) functions.php get included after the child theme functions.php? So, the remove_action is occurring before the add_action?
Since the child theme functions.php loads first you have to add an action that removes the other action before it tries to execute it. Since the core action runs at default priority 10, you just have to hook in at priority 9.
Here is how to do it:
function remove_header_support() {
remove_action( 'init', 'bp_dtheme_add_custom_header_support' );
}
add_action( 'init', 'remove_header_support', 9 );
Excellent. Works perfectly. Thanks MrMaz
MrMaz for president…
hum, ok, maybe not… as dedicated and friendly coder, well !!!
function remove_header_support() {
remove_action( 'init', 'bp_dtheme_add_custom_header_support' );
}
add_action( 'init', 'remove_header_support', 9 );
this works!…thanks guys and MrMaz
I used this successfully as well. Thanks!
I have a slightly different need. I got rid of the header and have my own, but on my home page I have a larger header area then on all other pages. I solved this by php code by detecting if on the home page:
<?php if( bp_is_front_page() ){ ?>
<link rel=’stylesheet’ href=’wp-content/themes/coffeehouse/large-masthead.css’ type=’text/css’ media=’screen’ />
<?php } ?>
I can also do this for other pages by determining the slug such as Blogs.
How do I do the same for the child pages of the Members area? Is that a different directory? I tried using the template tags without success.
Tip: Remove custom headers in your child theme
If you want to remove the ability to have custom headers in your child theme you simply add the following line in functions.php for your child or parent theme:
define( ‘BP_DTHEME_DISABLE_CUSTOM_HEADER’, true );
more easy , true?