Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#3779 closed defect (bug) (fixed)

XHTML validation problem with default theme

Reported by: pishmishy's profile pishmishy Owned by: ryan's profile ryan
Milestone: 2.2 Priority: low
Severity: minor Version: 2.1
Component: Template Keywords: has-patch
Focuses: Cc:

Description

The default/kubrick Wordpress them doesn't validate as XHTML on some pages - it'd be nice if it did. The problem is caused by an empty list on the home page of your blog, where a notice would normally appear to inform you that you were browsing the archives. The problem code is between lines 14 and 39 of sidebar.php.

Replacing line 14 with:

<?php /* if any of these */ if
                        (
                                is_404()||
                                is_category()||
                                is_day()||
                                is_month()||
                                is_year()||
                                is_search()||
                                (
                                        isset($_GET['paged']) &&
                                        !empty($_GET['paged'])
                                )
                        )
                                { ?>
                        <li>
                        <?php }

?>

and line 39 with


                  <?php /* if any of these */ if
                        (
                                is_404()||
                                is_category()||
                                is_day()||
                                is_month()||
                                is_year()||
                                is_search()||
                                (
                                        isset($_GET['paged']) &&
                                        !empty($_GET['paged'])
                                )
                        )
                        { ?>
                        </li>
                        <?php } ?>

Appears to fix the problem. Is this a bug in wordpress or do I need to contact the theme's author?

James

Attachments (1)

sidebar.php.diff (959 bytes) - added by pishmishy 18 years ago.
corrected patch

Download all attachments as: .zip

Change History (11)

#1 @pishmishy
18 years ago

  • Component changed from Administration to Template

#2 @JeremyVisser
18 years ago

  • Milestone changed from 2.3 to 2.1.1

#3 @Viper007Bond
18 years ago

WordPress bug as the theme is now managed by WordPress and not the original author.

#4 @Nazgul
18 years ago

  • Milestone changed from 2.1.1 to 2.1.2

#5 @pishmishy
18 years ago

  • Cc james@… added

I've created a patch to correct this issue.

#6 @Nazgul
18 years ago

  • Keywords has-patch added

#7 @ryan
18 years ago

Instead of doing the if twice, perhaps do it once and wrap it around that entire sidebar block.

@pishmishy
18 years ago

corrected patch

#8 @pishmishy
18 years ago

Patch adjusted as suggested, with a slight bug fix (must close a list with </li>!)

#9 @foolswisdom
18 years ago

  • Milestone changed from 2.1.3 to 2.2
  • Owner changed from anonymous to ryan

#10 @ryan
18 years ago

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

(In [5127]) Don't output empty list. Props pishmishy. fixes #3779

Note: See TracTickets for help on using tickets.