Forums

Simple WAI (web accessibility) hack (5 posts)

  1. Typey
    Member
    Posted 4 years ago #

    Hi,

    I was interested to see that Chris J. Davis has made his site meet all the Web Accessibility Initiative guidelines (designed to help blind or otherwise disabled people surf the net). With two small modifications, the default Kubrick template can meet almost all of the WAI guidelines (and all of the Priority 1 guidelines).

    All modifications should be made to files in wp-contern/themes/default.

    1. In searchform.php, replace this:

      <input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />

      with this:

      <label for="s"><span style="display: none;">Search this site </span><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" alt="Search this site" /></label>

    2. In header.php, replace this:

      <html xmlns="http://www.w3.org/1999/xhtml">

      with this (assuming your site is in English):

      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="eng">

    You can check the accessibility of your site with Cynthia Says at http://www.contentquality.com/.

  2. Typey
    Member
    Posted 4 years ago #

    Oops. That directory path should be:

    wp-content/themes/default

  3. tdw
    Member
    Posted 4 years ago #

    "style=display:none" is invisible to screen readers. This means that while Chris' page technically meets the WAI standards it actually does nothing to improve accessibility at all unless viewed with a text-only browser such as Lynx.

    What you can do to make content visible to screen readers, but not show up in your visual design is use the 'off-left method'.

    For the example above, put the following rules in your stylesheet:

    label span {
    position:absolute;
    left: -10000px;
    }

  4. Typey
    Member
    Posted 4 years ago #

    Well, I should say that "display: none" was my method, not Chris's; from checking out his site, I'm sure if it was his it would have worked correctly.

    Thanks for the tip.

    Jamie

  5. luvvaduck
    Member
    Posted 4 years ago #

    Post by Bruce Lawson of the web standards project on hacking wordpress for accessibility http://www.brucelawson.co.uk/index.php/2005/wordpress-accessibility-hacks/

Topic Closed

This topic has been closed to new replies.

About this Topic