Skip to:
Content

BuddyPress.org

Changeset 4181


Ignore:
Timestamp:
04/09/2011 02:21:55 PM (15 years ago)
Author:
djpaul
Message:

Before fetching a post thumbnail image, check that the feature is still enabled). Also fix a potential PHP notice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/functions.php

    r4113 r4181  
    274274    global $post;
    275275
    276     if ( is_singular() && has_post_thumbnail( $post->ID ) ) {
     276    $header_image = '';
     277
     278    if ( is_singular() && current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) ) {
    277279        $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' );
    278280
     
    280282        if ( !empty( $image ) && $image[1] >= HEADER_IMAGE_WIDTH )
    281283            $header_image = $image[0];
     284
     285    } else {
     286        $header_image = get_header_image();
    282287    }
    283288
    284289    if ( empty( $header_image ) )
    285         $header_image = get_header_image();
     290        return;
    286291?>
     292
    287293    <style type="text/css">
    288294        #header { background-image: url(<?php echo $header_image ?>); }
     
    293299        <?php } ?>
    294300    </style>
     301
    295302<?php
    296303}
Note: See TracChangeset for help on using the changeset viewer.