Collapse Header Image if No Custom Image is Uploaded (5 posts)

  1. myladeybugg
    Posted 3 years ago #

    Is there a way I can collapse the header image if no custom image is uploaded? I am using a child theme of the buddypress default theme.

    I found this thread, but did not see the code specified here in my header.php file.

    But, I did find this in my functions.php file:

    if ( !defined( 'BP_DTHEME_DISABLE_CUSTOM_HEADER' ) ) {
    		define( 'HEADER_TEXTCOLOR', 'FFFFFF' );
  2. noahjonah
    Posted 3 years ago #

    Do you not want the "header image" taken out of your site ?
    Take the Header image call out of header.php

  3. myladeybugg
    Posted 3 years ago #

    I am looking to have the header image collapse if there is no uploaded custom header.

    For example when a new site is created no custom header has been uploaded. Instead of having a default background color show I don't want anything to show. And then once the user uploads an image, their image will display.

    Hope this makes sense. :)

  4. Trionic Labs
    Posted 3 years ago #

    Why not just make sure the wrapping div does not specify a height (or force height:auto) in the stylesheet?

    Then that div will wrap the content, and if there is no image displayed, then it will be 0 height.

    (If there is a default image that takes the place of a missing image then this will not work - but you could override the default image with a 1x1 pixel transparent image to minimize the height it brings.)

  5. myladeybugg
    Posted 3 years ago #

    Sounds like this would be an easy solution. But I can't seem to get it to work. I am using a child theme of the buddypress default theme, where would I find if they have a default image set?

    Also, I have a height and width set in the themes function.php file. I changed the height in here to auto, but still didn't work.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.