Support » Fixing WordPress » Validator chokes on slug code

  • Resolved kimijye


    The html & css validators are choking on text automatically generated by the “slug” code:

    Line 178, character 114:
    … ur-email-belong-to-you/&title=Does your email belong to you? …
    Warning: reference not terminated by refc delimiter

    I’d like my xhtml documents to validate. I’d also like to be able to check my css file remotely, which is impossible now, as the css validator won’t move beyond the error to review my stylesheet.

Viewing 11 replies - 1 through 11 (of 11 total)
  • /&title=...

    That is not a default url component of WordPress. Are you running a plugin that generates this? Or perhaps your theme template is a little buggy.

    This is entirely possible. I’m using the default template in 2.0.5 which I’ve modified quite a bit – but I didn’t modify the line in question. And it is the case that this line refers to slug code which was automatically generated from the backend admin area.

    What do I need to show to get help learning how to resolve this?

    The error is actually coming from the “ADD to” link at the foot of the page:

    <a href=" your email belong to you?">ADD to</a>

    You need to look at whatever you’re using to insert that. If it’s something you’ve put into your footer, try changing the & to &amp;

    The illegal character is being automatically generated. I’ve tried to figure out how to fix this but no joy. Is there something I can change in the code or in my htaccess file to correct the output that’s generating the illegal character?

    <p><?php the_time('l, F jS, Y') ?> at <?php the_time() ?></p>
    <p>CATEGORY <?php the_category(', ') ?></p>
    <p><a href="feed:<?php bloginfo('rss2_url'); ?>">RSS</a>&nbsp;&nbsp;|&nbsp;&nbsp;
    <a href="feed:<?php bloginfo('comments_rss2_url'); ?>">Comment Feed</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="<?php trackback_url(true); ?>" rel="trackback">Trackback&nbsp;&nbsp;|&nbsp;&nbsp;
    <a href="<?php the_permalink(); ?>&title=<?php the_title() ?>">Add to</a></p>

    If you don’t put your code in between backticks [`] as it is instructed below… everything becomes useless here because it renders.

    Thanks for explaining those instructions to me. I’ve done all kinds of searches in the last 1/2 hour trying to figure out how to get my code to read.

    1. As LesBessant explained above – the culprit is the & in that code.
    1a. He also gave you the solution. Did you try it?
    2. You said: it is generated. By what? By the code you posted above? – If yes, see 1a.

    I have tried it and a dozen other possible solutions ; < . I just tried it once again and got the same error message. The problem seems to be that the illegal character is not being escaped properly.

    I don’t think so…
    Just tried your code on a test install and it works, IF you replace the & with &amp; – i.e.

    I was modifying the wrong file – the single.php instead of footer.php. When I changed the footer file and uploaded it, the page did work. Thanks for sticking with me to help me resolve this error. Both files needed to be changed in any event . . . Now they’re both correct . . .

    Maybe mark this resolved then, thanks?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Validator chokes on slug code’ is closed to new replies.