WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. myladeybugg
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

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

  3. myladeybugg
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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

Tags

No tags yet.