• Resolved sandra408

    (@sandra408)


    Can’t figure out why my css does not affect footer color:

    #footer {
    	margin-bottom: 20px;
    	background-color: #F6F7CB;
    }

    Am I missing something?
    Or does it suppose to be somewhere else??

    Thanks for anyone’s input.

Viewing 7 replies - 1 through 7 (of 7 total)
  • please post a link to your site to illustrate the problem.

    possibly try also to edit the style of #colophon

    try working with a browser inspection tool such as Firebug to find out what styles are responsible for formatting the footer.

    Thread Starter sandra408

    (@sandra408)

    Thanks, I’ll check it out.

    I just saw your reply to another thread on how to keep branding image only on home page. I’ve run into the same problem.
    I have custom home page with home.css. I was hoping by using #branding img {display: none;} in my regular style.css file I would get rid of the branding image on the rest of the site’s pages. But somehow it affects my home.css file also and image does not show on the home page also.

    I tried to implement your header.php editing method like this:

    <?php if(is_home()): ?>
    					// Check if this is a post or page, if it has a thumbnail, and if it's a big one
    					if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
    							has_post_thumbnail( $post->ID ) &&
    							( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    							$image[1] >= $header_image_width ) :
    						// Houston, we have a new header image!
    						echo get_the_post_thumbnail( $post->ID );
    					elseif ( get_header_image() ) :
    						// Compatibility with versions of WordPress prior to 3.4.
    						if ( function_exists( 'get_custom_header' ) ) {
    							$header_image_width  = get_custom_header()->width;
    							$header_image_height = get_custom_header()->height;
    						} else {
    							$header_image_width  = HEADER_IMAGE_WIDTH;
    							$header_image_height = HEADER_IMAGE_HEIGHT;
    						}
    					?>
    						<img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
    					<?php endif; ?>
    <?php endif; ?>

    I guess I messed up somewhere… it did not work for me. Did I make a mistake somewhere?

    Thank you for your time.
    S.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    please post a link to your site to illustrate the problem

    Thread Starter sandra408

    (@sandra408)

    Sorry, the site is in The Maintenance Mode at this point.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Share your HTML and CSS for that page, using PasteBin and link us those PasteBin pages.

    try to overwrite
    #branding img {display: none;}
    with an additional
    .home #branding img {display: block;}

    it did not work for me

    in which way? what was the result, if any?

    is_home() checks for the ‘posts page’;
    is_front_page() checks for the front page;

    http://codex.wordpress.org/Conditional_Tags

    Thread Starter sandra408

    (@sandra408)

    Here is what worked finally for the branding image in the home page header only:

    <?php if( is_home () || is_front_page() ) :?>  <?php
    					// Compatibility with versions of WordPress prior to 3.4.
    					if ( function_exists( 'get_custom_header' ) ) {
    						// We need to figure out what the minimum width should be for our featured image.
    						// This result would be the suggested width if the theme were to implement flexible widths.
    						$header_image_width = get_theme_support( 'custom-header', 'width' );
    					} else {
    						$header_image_width = HEADER_IMAGE_WIDTH;
    					}
    
    					// Check if this is a post or page, if it has a thumbnail, and if it's a big one
    					if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
    							has_post_thumbnail( $post->ID ) &&
    							( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    							$image[1] >= $header_image_width ) :
    						// Houston, we have a new header image!
    						echo get_the_post_thumbnail( $post->ID );
    					elseif ( get_header_image() ) :
    						// Compatibility with versions of WordPress prior to 3.4.
    						if ( function_exists( 'get_custom_header' ) ) {
    							$header_image_width  = get_custom_header()->width;
    							$header_image_height = get_custom_header()->height;
    						} else {
    							$header_image_width  = HEADER_IMAGE_WIDTH;
    							$header_image_height = HEADER_IMAGE_HEIGHT;
    						}
    					?>
    						<img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
    					<?php endif; ?>
    <?php endif;?>

    I also remover hard-coded footer text and put it into a footer widget. Now the footer bg color shows…

    Thanks everyone for the help.
    S.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Footer background color is not showing in TwentyTen.’ is closed to new replies.