Banner Issue

Hi, This is an issue with PHP & CSS. I really need help on this please!

        if ( is_singular() && 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 && !get_option('graphene_featured_img_header')) {
			// Houston, we have a new header image!
			// Gets only the image url. It's a pain, I know! Wish Wordpress has better options on this one
			$header_img = get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
			$header_img = explode('" class="', $header_img);
			$header_img = $header_img[0];
			$header_img = explode('src="', $header_img);
			$header_img = $header_img[1];
		} else {
			$header_img = get_header_image();
		 * Check if the page uses SSL and change HTTP to HTTPS if true 
		 * Currently commented out as it causes more trouble than it fixes. If you want 
		 * to use it, just uncomment it.
		if (is_ssl() && !stripos($header_img, 'https')){
			$header_img = str_replace('http', 'https', $header_img);	
		// Gets the colour for header texts, or if we should display them at all
		if ( 'blank' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR) || '' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR))
			$style = ' style="display:none;"';
			$style = ' style="color:#' . get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) . ';"';
        <div id="header" style="background-image:url(images/banner.jpg);">
        	<?php if (get_option('graphene_link_header_img')) : ?>
            <a href="<?php echo home_url(); ?>" id="header_img_link" title="<?php esc_attr_e('Go back to the front page', 'graphene'); ?>">&nbsp;</a>
            <?php endif; ?>
        	<h1 <?php echo $style; ?> class="header_title"><a <?php echo $style; ?> href="<?php echo home_url(); ?>" title="<?php esc_attr_e('Go back to the front page', 'graphene'); ?>"><?php bloginfo('name'); ?></a></h1>
            <h2 <?php echo $style; ?> class="header_desc"><?php bloginfo('description'); ?></h2>
            <?php do_action('graphene_header'); ?>


I am working with the graphene theme stripped down majorly (wordpress).

I have an issue with the banner - I cant get it to display my own banner, it wants to use the random ones that come with the theme.

I have tried adjusting the themes CSS (see above), but this doesn’t change anything.

Is there any way to adjust the PHP code so that it will display all my images randomly, with the height and width settings which I have set in CSS?

Any help on this would be greatly appreciated.


Since it’s a problem with the particular banner that appears, I’m going to say this is a PHP issue, since CSS can’t say which content shows up.

Want a mod to move this over to the PHP section? If that part gets fixed and then you have CSS problems, you can always make a new post over here and just link to this old one so people can see the original problem too if they need to.

Just don’t make a new thread anywhere yet. If you want this over in PHP, click the orange flag/report post under your name and say “move to PHP please” and a mod will move the thread over.

Oh, CSS-wise, the reason it’s a crappy idea to have inline styles set the background image like that is that your external CSS file will never be able to override that (which is why they did it that way, apparently). So in your PHP, you’ll need to figure out how to get rid of that style=“blah.jpg” entirely if you want your own CSS-based background image to show.