Make WordPress More Links Accessible

While the wordpress blogging package does an admirable job publishing valid XHTML/CSS with good semantic code there is one feature which fails accessibility guidlelines.

This is the (more�) feature, which allows the bloggers to display the first part of a long post and then link to the whole post at the bottom with an automated link eg:

(more�)

If the more feature is used several times in a page eg: on a blog homepage than most of the links on the page will have the link text (more�) which is not very accessible.

While wordpress does allow users to customize the more tag, all this does is replace (more�) with another few words which will be used repeatedly instead eg: (read more�)

The solution to make the link more accessible therefore has 2 parts:

  1. Follow the instructions in the first paragraph of customize the �more� tag to change (more�) to (read more�)
    • Open template-functions-post.php from your blogs wp-includes folder.
    • Replace the line (around line 128ish):

      $output .= ' <a href="'. get_permalink() . "#more-$id">$more_link_text</a>";

      With these 2 lines instead:

      $title = get_the_title();
      $output .= ' <a href="'.get_permalink(). "#more-$id">$more_link_text $title</a>";

  2. Upload the changed index.php and template-functions-post.php to the appropriate directories on your web server

So now when you use the more feature, wordpress will use the title of your post to automatically generate a much more accessible link than (more�) eg: read more about Make- WordPress More links accessible

5 thoughts on “Make WordPress More Links Accessible”

  1. Hi Neerav,
    Good to see others finding solutions to this problem as well…

    The function WP uses to display an article’s content is: the_content(). If you check out its functionality, you can accomplish the same thing. In my index.php I use:

    the_content("Continue reading " . the_title('','',false), 0);

    I had started down the same path as you, then found that the_content() function did what I wanted to, so I backed out my changes… I think the only disadvantage of modifying template-post-functions.php is that when you upgrade your WP installation it will be a bit more of a hassle to manage all the manual changes that have been made…

  2. I just came upon this as I was updating my WP 1.5 install. To further aid in this implementation, here’s something else. If you modify “the_content” on your index.php page, you can change the words used in the “more” link *and* you can add something before and after the title of the linked entry:
    the_content("Continue reading " . the_title('','',false), 0);
    Those two instances of ” in the parentheses allow for what you want before the title and what you want after the title of the page. I wanted quotation marks around and bold lettering of the title of the entry in my “more” link. Here’s all I did:

    the_content("Read more of " . the_title('"','"',false), 0);

    Also, I wanted that link to go to just the page for the article, not bookmarked down the page to wherever I put in the “more” quicktag. Editing template-post-fucntions.php, I replaced this:
    $output .= ' $more_link_text";
    with this:

    $output .= ' $more_link_text";

    Opening up template-post-functions.php and searching for “#” will get you to that line.

Leave a Reply

Your email address will not be published. Required fields are marked *