Make WordPress Core

Opened 16 years ago

Closed 15 years ago

#7121 closed defect (bug) (fixed)

Wordpress default theme does not use correct background

Reported by: christmasboy81's profile christmasboy81 Owned by: nicholas91's profile Nicholas91
Milestone: 2.8 Priority: normal
Severity: minor Version: 2.5.1
Component: General Keywords: has-patch tested
Focuses: Cc:

Description

In 2.5 and 2.5.1, for the main page, the default theme (kubrick) uses kubrickbgwide.jpg for the background and not kubrickbg-ltr.jpg, like it should.

I did some research and the problem is in wp-content/themes/default/header.php and was broken in revision 6711, which was to fix ticket 3155.

The offending line is 17 and is currently

if ( !empty($withcomments) && !is_single() ) {

In the previous revision (6195) it was

if ( !$withcomments && !is_single() ) {

I think the correct change would be the following (although I know hardly anything about PHP or wordpress)

if ( empty($withcomments) && !is_single() ) {

This problem has been reported several times on the wordpress support forums. http://wordpress.org/support/topic/167648?replies=5 http://wordpress.org/support/topic/165580?replies=1 http://wordpress.org/support/topic/178600?replies=2

Attachments (1)

ltr-bg.diff (564 bytes) - added by seth 15 years ago.
patch

Download all attachments as: .zip

Change History (9)

#1 @christmasboy81
16 years ago

  • Summary changed from Wordpress default theme does use correct background to Wordpress default theme does not use correct background

The title of the ticket should be "Wordpress default theme does not use correct background.

Sorry about that.

#2 follow-up: @hansengel
16 years ago

This bug doesn't seem to be existent with r8071.. my background is loaded from /wp-content/themes/default/images/kubrickbgcolor.jpg .

#3 in reply to: ↑ 2 @christmasboy81
16 years ago

Replying to hansengel:

This bug doesn't seem to be existent with r8071.. my background is loaded from /wp-content/themes/default/images/kubrickbgcolor.jpg .

Sorry, this is related to the page background (where the content is), and not the body background.

The full code from header.php is:

15 	<?php
16 	// Checks to see whether it needs a sidebar or not
17 	if ( !empty($withcomments) && !is_single() ) {
18 	?>
19 	    #page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg-<?php bloginfo('text_direction'); ?>.jpg") repeat-y top; border: none; }
20 	<?php } else { // No sidebar ?>
21 	    #page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
22 	<?php } ?>

The result is that the entire body is the color of kubrickbgwide.jpg. kubrickbg-ltr.jpg has a colored area for the sidebar.

#4 @christmasboy81
16 years ago

  • Milestone changed from 2.5.2 to 2.6

@seth
15 years ago

patch

#5 @seth
15 years ago

  • Keywords has-patch added

He's right and so is his fix. Patch attached.

#6 @seth
15 years ago

  • Milestone changed from 2.9 to 2.8
  • Owner changed from anonymous to seth
  • Status changed from new to assigned

#7 @Nicholas91
15 years ago

  • Cc dragos.nicholas@… added
  • Keywords tested added
  • Owner changed from seth to Nicholas91
  • Status changed from assigned to new

Tested on Ubuntu/Firefox + Opera. The background uses the correct jpg file.

#8 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [10949]) Fix logic inversion. Props christmasboy81. fixes #7121

Note: See TracTickets for help on using tickets.