Viewing 8 replies - 1 through 8 (of 8 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Do you think you could use the HTML entity of & in the errors such as,

    Line 113, Column 57:
    general entity “appId” not defined and no default entity
    js.src = “//connect.facebook.net/en_US/all.js#xfbml=1&appId=395575387176119”;

    What’s happening here is wherever the ampersand symbol is used, the browser tries to read the preceding characters as a HTML entity. To prevent this, you ought to use the ampersand HTML entity, which is found on this page https://www.w3schools.com/html/html_entities.asp .

    That said (and speaking as something of standardista), it a very minor issue and is unlikely to cause a problem in any user agent. How are you adding these opengraph tags? Manually?

    Thread Starter Johnny Bravo

    (@herbiehysteria)

    hi esmi, yes i tried adding them manually to header.php, but everytime i added the opengraph code my site went blank, just recently i manually inserted the fb comments widget into comments.php, for which i needed a couple of fb meta tags, so i used meta tag manager plugin to add fb:app_id and fb:admins for it to work.

    i really need all the opengraph tags inserted into my site but am stuck as to how to safely add them manually.

    Could you give us an example of a tag that you tried to add manually?

    Thread Starter Johnny Bravo

    (@herbiehysteria)

    <meta property="fb:app_id" content="Your_FB_APP_ID" />
    <meta property="og:title" content="<?php the_title(); ?>"/>
    <meta property="og:description" content="<?php echo $post->post_excerpt;?>"/>
    <meta property="og:url" content="<?php the_permalink(); ?>"/>
    <meta property="og:image" content="<?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '', '' ); echo $src[0];
    ?>"/>
    <meta property="og:type" content="<?php  if (is_single() || is_page()) { echo "article"; } else { echo "website";}
    ?>"/>
    <meta property="og:site_name" content="<?php bloginfo('name'); ?>"/>

    with my info added obv ??

    Try replacing <?php echo $post->post_excerpt;?> with <?php the_excerpt_rss();?>. I can’t see anything else in there that would usually generate an ampersand – other than perhaps Your_FB_APP_ID.

    Thread Starter Johnny Bravo

    (@herbiehysteria)

    i have added the above and my site doesnt go blank, so it’s accepted the above opengraph tags, but i’m still at the same error count on w3c and my fb comments widget has an ‘url is unreachable’ warning each time it is displayed on a different post.

    https://www.artbyherbie.com/4093/project-management-ultimate-strength-and-fitness-nelson/

    None of those validation errors relate to your opengraph tags in the header.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘w3c validator errors’ is closed to new replies.