Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to override Buddypress functions.php code for custom image headers?

  • @notpoppy

    Participant

    I’m using a custom child theme based on the default Buddypress theme. This code in functions.php for the default Buddypress theme is giving me some trouble:

    ` // Add custom header support if allowed
    /* if ( !defined( ‘BP_DTHEME_DISABLE_CUSTOM_HEADER’ ) ) {
    define( ‘HEADER_TEXTCOLOR’, ‘FFFFFF’ );

    // The height and width of your custom header. You can hook into the theme’s own filters to change these values.
    // Add a filter to bp_dtheme_header_image_width and bp_dtheme_header_image_height to change these values.
    define( ‘HEADER_IMAGE_WIDTH’, apply_filters( ‘bp_dtheme_header_image_width’, 1250 ) );
    define( ‘HEADER_IMAGE_HEIGHT’, apply_filters( ‘bp_dtheme_header_image_height’, 133 ) );

    // We’ll be using post thumbnails for custom header images on posts and pages. We want them to be 1250 pixels wide by 133 pixels tall.
    // Larger images will be auto-cropped to fit, smaller ones will be ignored.
    set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );

    // Add a way for the custom header to be styled in the admin panel that controls custom headers.
    add_custom_image_header( ‘bp_dtheme_header_style’, ‘bp_dtheme_admin_header_style’ );
    } */`

    Because of this, whenever I create a post with a gallery in it, then select an image as the featured image, the image appears in my theme header. I don’t want this to happen.

    I’ve found I can fix the problem by editing out this code in functions.php. But obviously this is not a long-term solution.

    Ideally I need to add some code to the functions.php in my custom theme to disable it. But, despite having tried a few likely-looking solutions I found in the forum, nothing so far has worked.

    Can anyone tell me how I can fix this?

Viewing 1 replies (of 1 total)
  • @modemlooper

    Moderator

    Disable the custom header functionality on the default BuddyPress theme:
    define( ‘BP_DTHEME_DISABLE_CUSTOM_HEADER’, true );

Viewing 1 replies (of 1 total)
  • The topic ‘How to override Buddypress functions.php code for custom image headers?’ is closed to new replies.
Skip to toolbar