Support » Fixing WordPress » Issues with open graph (url and title)

  • Hi,
    in my site, to integrate opengraph first I triyed to install a plugin for opengraph integration but doesn’t work andh than I’ve modifyed the code as you can see but I’ve followed the instructions in variuos sites, including open graph directly in the code.

    Now I guess a problea in the post, so the error is this:

    Altought when I try to share a post I can’t see the image and the description, only the title appears.

    I’ve the same problems with comments and with like (when someone like a post this doesn’t show in FB)..

    This is the code I’ve inserter in my site. Can you help to find the problem please?


    In HEAD I’ve inserted this:

    <?php if (have_posts()):while(have_posts()):the_post(); endwhile; endif;?>
    <!-- Valori iniziali -->
    <meta property="fb:app_id" content="342582249174051">
    <!-- Se la pagina è un articolo -->
    <?php if (is_single()) { ?>
    <meta property="og:url" content="<?php the_permalink() ?>">
    <meta property="og:title" content="<?php single_post_title(''); ?>">
    <meta property="og:description" content="<?php echo strip_tags(get_the_excerpt($post->ID)); ?>">
    <meta property="og:image" content="<?php if (function_exists('catch_that_image')) {echo catch_that_image(); }?>">
    <!-- Se è una qualunque altra pagina -->
    <?php } else { ?>
    <meta property="og:site_name" content="<?php bloginfo('name'); ?>">
    <meta property="og:description" content="<?php bloginfo('description'); ?>">
    <meta property="og:image" content=""> <?php } ?>

    In BODY I’ve inserted this:

    <div id="fb-root"></div>
    window.fbAsyncInit = function() {
    FB.init({appId: '342582249174051', status: true, cookie: true,
    xfbml: true});
    (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your posted code may now have been permanently damaged/corrupted by the forum’s parser.]

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issues with open graph (url and title)’ is closed to new replies.