Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #5255

    I can’t seem to get thumbnails to be recognized by Facebook’s Open Graph protocol, either by hardcode or plugins. I had it working with the featured images in Avisio but nothing seems to work with Brightbox.

    Any suggestions?

    Overall, I thing the image management of the Brightbox theme has issues.

    In addition to the latest posts not being recognized in the dynamic templates… Portfolio comments…..

    #49433

    Hey,

    as far as I know Brightbox doesn’t use the standard post thumbnail function (featured image function). The reason is that there’re some limitations (i.e. you can only attach one featured image without hacking the function and/or using plugins) and you can’t create multiple slideshows with the standard featured image function. Some users reported problems with facebook so I’ll ask Kriesi to modify the post image managment a bit (i.e. that the first image is set as post thumbnail too, etc..

    2) It’s a known bug and it will be fixed in the next update.

    3) Comments are activated for portfolio pages too but you can deactivate the feature. Open up brightboxincludesadminregister-portfolio.php and replace:

    'supports' => array('title','thumbnail','excerpt','editor','comments')

    with:

    'supports' => array('title','thumbnail','excerpt','editor')

    #49434

    With Avisio This is the hard code I used to meet my needs with the Facebook Open Graph Protocol

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <?php global $k_option, $query_string; $k_option['custom']['real_query'] = $query_string; ?>
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/">

    followed by:

    <!-- Facebook Opengraph -->
    <meta property="fb:app_id" content="My Application ID" />
    <meta property="fb:admins" content="My Admin ID" />
    <?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 the_excerpt_rss() ?>" />
    <meta property="og:type" content="article" />
    <meta property="og:image" content="<?php echo wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ) ) ?>" />
    <?php } else { ?>
    <meta property="og:site_name" content="My Website Name" />
    <meta property="og:url" content="http://myurl.com"/>
    <meta property="og:description" content="<?php bloginfo('description'); ?>" />
    <meta property="og:type" content="website" />
    <meta property="og:image" content="http://A default image url for the website.com" />
    <?php } ?>

    The first pice of code needs to be rewritten for Brightbox. The second for the most part is good. The line I can’t seem to get right due to the way images are handled in the Brightbox theme is this:

    <meta property="og:image" content="<?php echo wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ) ) ?>" />

    is there a chance you or Kriesi could take a look at this last line of code to pull the first thumbnail from the post? And possibly rewrite the first line for Brightbox?

    Thanks,

    Jay

    #49435

    I think a global solution is better because there are some other plugins which depend on post thumbnails too. Kriesi will look into all requests within the next few days and hopefully find a clever solution. If not we need to adjust the plugin….

    #49436

    Ok – Kriesi will improve the framework but this will take some time. For now you can replace:

    <meta property="og:image" content="<?php echo wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ) ) ?>" />

    with:

    <meta property="og:image" content="<?php echo wp_get_attachment_thumb_url( $slides[0]['slideshow_image'] ) ?>" />

    #49437

    I agree with you on a global solution. The thumbnail issue also effects RSS feeds…… Something crafty is needed. Unfortunately, I don’t have those skills to create it…. It just drives me nuts to see people sharing my site/articles on Facebook and the lack of the images.

    #49438

    Still picking away at this. I have been going through testing the plugins that search for what should be the fist image in a post to use as a thumbnail for Facebook. So far, I have yet to find one that works properly. They all seem to just grab a random image from the library.

    #49439

    Have you tried the solution I posted above?

    #49440

    I did, but that is basically the same as delivering a random image to Facebook.

    When someone likes a photograph or article on a website, the actual image or lead image for the article should appear on Facebook, Digg or any of these networks. When I was using Avisio I was able to have each page recognized as an object by Facebook. The amount of traffic coming back to my website from people liking and sharing my pages was huge. The move to Brightbox killed that traffic. If this can’t be fixed, then I have to suck it up and change themes yet again. The loss of of web traffic from this is too significant.

    In my opinion, there is a huge flaw with the way this framework handles images and thumbnails. It not only effects Facebook, but RSS feeds, as well as limiting the use of any plugins that are looking for the thumbnail to a post.

    If it is what it is and can’t be fixed; then I need to know so I can move on to something that works with the way people are currently sharing information with others.

    #49441

    The code doesn’t deliver a random image to facebook but the first object in the array. So basically it will display the first image you set in the featured media option field. You can control which image is the first one and imho this workflow can’t be called “random”.

    This is no limitation compared to post thumbnails because you can only set one post thumbnail too. If you’d like to change the image you can use $slides[1], $slides[2], etc. but of course this code won’t work for posts with only one featured image ….

    #49442

    My mistake, I originally saw older posts displaying random images. Who knows, as they are old, which image was upload first. For now, the line of code calling for the slide works fine.

    To bring anyone else up to speed:

    I currently using the Yoast SEO plugin which handles the basic Facebook Open Graph functions and in jets the basic metadata into the head call. I simply the below line of code from Dude:

    <meta property="og:image" content="<?php echo wp_get_attachment_thumb_url( $slides[0]['slideshow_image'] ) ?>" />

    To the header.php file right after this line of code:

    <?php

    /* Always have wp_head() just before the closing </head>
    * tag of your theme, or you will break many plugins, which
    * generally use this hook to add elements to <head> such
    * as styles, scripts, and meta tags.
    */

    wp_head();
    ?>

    The end result, probably considered sloppy, works perfectly fine as long as the SEO plugin is active.

    Thank you to both Dude and Kriesi for their efforts on this.

    #49443

    Thanks for providing the code :)

Viewing 12 posts - 1 through 12 (of 12 total)

The topic ‘Facebook Open Graph Protocol’ is closed to new replies.