Ever since reading that using the “more” button in the WordPress dashboard results in accessibility issues I’ve been meaning to find a way round it. But with so many other things to fix (resizable fonts!), I’d put it on the back burner and stopped writing extended posts. Then tonight I fell upon a solution by accident.
First up, why is it a problem? Well, the W3C Web Content Accessibility Guidelines (WCAG) state that
If more than one link on a page shares the same link text, all those links should point to the same resource. Such consistency will help page design as well as accessibility.
If a page on this blog has, say, 10 posts and two or more of those posts contain extended text, then two or more of those posts will have a “more” link leading to two different places.
In the index file (index.php) you’ll see some code like this:
<?php the_content('<br /><br />[more...]'); ?>
It might vary slightly, depending on the theme you’re using but you want to change the content of the php statement, i.e. everything except:
at the start and
at the end (these are the opening and closing tags, just like, for example, the <h1> and </h1> tags of html.
You replace that with:
the_content("Continue reading " . the_title('','',false), 0);
And your finished line is now:
<?php the_content("Continue reading " . the_title('','',false), 0); ?>
I’ve had to put spaces in the code above so that it’s visible but you can see screenshots of the code as follows:
If you’re not confident about editing the index.php file, ask a friendly neighbourhood php geek and make a copy of the file before you start!
Next question: what’s the best way to display code (php, html, css) here without having to add spaces? I tried installing CodeSnippet a little while ago but not had much success. Maybe I’ll look at it again tomorrow. For now, to bed!