Viewing 8 replies - 1 through 8 (of 8 total)
  • The HTML validator can’t validate the & in your code… It’S a comon error..

    Thread Starter liaroms

    (@liaroms)

    I don’t know that much , but it seems to validate it in other places. I guess I should not worry about it but I would like to know if the code was right. I did not post the error code from the validator, so here it is. As you can see from the bold area a & sign is being pulled in from somewhere and no ; after it.

    # Warning Line 183, Column 305: cannot generate system identifier for general entity “bid”

    …amp;h=200&w=350&zc=1&q=80&bid=1″ alt=”Welcome to Our Restaurant” c…

    An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in “Ampersands in URLs”.

    Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as “&” (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and æ are different characters.

    If this error appears in some markup generated by PHP’s session handling code, this article has explanations and solutions to your problem.

    Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.

    Thread Starter liaroms

    (@liaroms)

    The first post is not showing the code right so here it is wrapped in code tags.

    <a title="<?php the_title(); ?>" href="<?php echo get_post_meta($post->ID, "url", true); ?>"><img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "image", $single = true); ?>&h=<?php echo $slideimgheight; ?>&w=<?php echo $slideimgwidth; ?>&zc=1&q=80<?php echo $thumb_url; ?>" alt="<?php the_title(); ?>" class="fl" /></a>

    Thread Starter liaroms

    (@liaroms)

    Well that did not work either

    Thread Starter liaroms

    (@liaroms)

    &h=<?php echo $slideimgheight; ?>&w=<?php echo $slideimgwidth; ?>&zc=1&q=80<?php echo $thumb_url; ?>”

    Moderator James Huff

    (@macmanx)

    For some reason, this forum is eating the correct formatting for the & symbol, so my lengthy post must go unseen. Please refer to this for your answer:

    https://htmlhelp.com/tools/validator/problems.html#amp

    Thread Starter liaroms

    (@liaroms)

    Thank for your reply. I already know about this and all of the & in the code are correctly done. But for some reason when using this forum I can’t write the proper format. If you look at my site in the validator and view source for line 183 you will see the correct code.

    My question is I don’t know where this extra & is coming from as it is not in the feature-slider.php file. It appears after the : q=80

    I’m just trying to find the problem if it is bad code or what? I have already found and fixed about 12 other errors from this theme. Mostly trailing tags not closed etc.

    Or I wonder could it be the <?php echo $thumb_url; ?> and if so what file would I look in.

    Moderator James Huff

    (@macmanx)

    Yeah, they’re coming from somewhere in that slideshow, probably in the plugin file, and probably <?php echo $thumb_url; ?> like you mentioned, in which case there’s really nothing that you can do about it short of editing WordPress’ core files or rewriting how the plugin queries the thumbnails.

    This might have to be one of those validation errors that you let slide. Despite the warning from the validator, &bid is not an separate HTML entity, so you really don’t have anything to worry about regarding browser compatibility.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘W3 site validation. 1 error left, can someone look at this code?’ is closed to new replies.