SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict Zapppa's Avatar
    Join Date
    Aug 2009
    Posts
    314
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Banner Problem help needed please!

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

    Code PHP:
            <?php
            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;"';
    		else
    			$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'); ?>
            </div>



    Code CSS:
    #header{
    background-image:url(images/banner.jpg);
    background-repeat:no-repeat;
    background-color:#000;
    height:280px;
    margin-left:16px;
    width:900px;
    }


    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.

    Thanks

  2. #2
    SitePoint Member
    Join Date
    Jan 2009
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you cleared your cache after you made the changes? Sometimes, the image is held in the cache, and even though you had made the change, you will see the old one.

  3. #3
    SitePoint Addict Zapppa's Avatar
    Join Date
    Aug 2009
    Posts
    314
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yep tried that :s


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •