Support » Fixing WordPress » “more” link text.

  • Hi.

    I am in a bit of a catch 22 situation here…

    I’m working on my accessibility for and have come across a problem.

    In order to pass WAI-AA standard I cannot have more than one unique link using the same link text. Fine, you might say but I come across the problem because I use the <!–more–> feature. This makes all the <!–more–> links on a particular page comprise of the same link text, in this case, “more…”

    What I want to know is: Is there a way of making the <!–more–> link text call the ID of the post it’s in? So for example, can i make the <!–more–> link for post ID 35 say “Read more of this post (35)” thus making it unique?

    It seems a shame if not because WordPress seems to fly the flag for nice use of web standards and such…

    Thanks in advance.


Viewing 12 replies - 1 through 12 (of 12 total)
  • Do you mean something like
    <php the_content("...continue reading the story called " . get_the_title('', '', false)); >?

    That’s all in the Codex pages.

    Maybe… what am I looking at there?

    Ah, you haven’t come to editing WP files yet? Maybe the Codex can be a tutorial. In any case, you’ll have to find the code that makes the excerpts (in index.php and perhaps archive.php) and change the code…
    If you’re going to ‘trial and error’, be sure to saveguard the original files (copy them to another place), open them in for example Notepad and study the bugger. With help of the Codex you may find what you’re looking for. After changing you can save and upload the file again (I use a test site when I’m not sure what I’m doing) and see if the result comes close to your wish.
    As for the rest, I’m not exactly a programmer, when I try to change something, it’s usually trial and error, so more specific information will have to come from someone with more technical insight.
    Good luck.

    I have done some editing before but I just needed more info as to what files I edit and where. Just showing me a snippet of PHP isn’t gonna do me much good. Cheers for your help though.

    Any other ideas here?

    one final *bump*

    Index.php and archive.php (or archives.php, I don’t know by heart) (if you want it ‘excerpted’). Look up the part that looks similar to what is posted above and replace it. If you’re not sure what you’re doing, follow the codex. If you’re still not sure, it might not be a good idea to try to edit in general, but since your request is relatively simple, it might help to give you some insight in PHP. I’m not at home, so I can’t view my own index.php to tell you what it looks like in my theme. Btw, my theme (Fluid Blue) has what you want standard if you use the “more” function in the editor.
    Like I said, you will have to open your index.php in a text editor (I use Notepad) and study it, try to see what it makes your website do.

    OK, I’ve found where I need to edit it but I don’t think that snippet is correct.

    At the moment mine reads:

    <?php the_content(‘Read more of this post…’); ?>

    But if I replace that with what you gave me it stops showing the post at all. It just shows the title, no content and then the post info.

    Right, that code indeed does contain a rather silly mistake. Try the following:

    <?php the_content("...continue reading the story
    called " . get_the_title('', '', false)); ?>

    Somehow the question mark got lost and the question mark that was there, was there because of my question 🙂
    Just to fool around a little, there are some more examples in the Codex page that I referred to.

    Oh, and copy-paste is a little dangerous, your editor might make a break between “story” and “called” or something.

    oops, my bad…

    I’ve sorted it now.

    Thanks for your help.

    I almost feel like I understand something of it all!!
    But now that the title is included, your problem is solved?

    Yes… all that was required was that each “more..” link had to have unique link text to satisfy WAI – AA standards.

    The battle is won, the war is far from over.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘“more” link text.’ is closed to new replies.