WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#3779 closed defect (bug) (fixed)

XHTML validation problem with default theme

Reported by: pishmishy Owned by: 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 7 years ago.
corrected patch

Download all attachments as: .zip

Change History (11)

comment:1 pishmishy7 years ago

  • Component changed from Administration to Template

comment:2 JeremyVisser7 years ago

  • Milestone changed from 2.3 to 2.1.1

comment:3 Viper007Bond7 years ago

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

comment:4 Nazgul7 years ago

  • Milestone changed from 2.1.1 to 2.1.2

comment:5 pishmishy7 years ago

  • Cc james@… added

I've created a patch to correct this issue.

comment:6 Nazgul7 years ago

  • Keywords has-patch added

comment:7 ryan7 years ago

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

pishmishy7 years ago

corrected patch

comment:8 pishmishy7 years ago

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

comment:9 foolswisdom7 years ago

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

comment:10 ryan7 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.