WordPress.org

Ready to get started?Download WordPress

Forums

WP Facebook Open Graph protocol
[resolved] Featured image for Thesis Framework Not Working (5 posts)

  1. Joe Manna
    Member
    Posted 1 year ago #

    First off, sweet plugin, Chuck and Andrew! :-)

    One issue I'm having is it doesn't pull the images used in our Thesis-based theme. I'm debating if I go through all the work of converting the uploads and moving over to post's Featured Images.

    I looked at the code and it is pulling the featured image I think from the post's featured image.

    Currently, this is the way I serve up featured images in our OGP tags and they work (not using the plugin, within custom functions):

    function add_facebook_open_graph_tags() {
    	if (is_single()) {
    	global $post;
    	$image = get_post_meta($post->ID, 'thesis_post_image', $single = true);
    	if (!$image)
    		$image = 'http:// [...] .png';
    	?>
    [...]
    <meta property="og:image" content="<?php echo $image; ?>"/>

    Is there a workaround or a fix for this?

    Thanks!

    http://wordpress.org/extend/plugins/wp-facebook-open-graph-protocol/

  2. darbielee
    Member
    Posted 1 year ago #

    Just wanted to add another voice for the same issue. One of my clients uses Thesis and we've discovered the same problem after starting to use this plugin. It's fantastic otherwise, so I'd rather not swap out a different plugin for them. But if I can't get around this, I might have to.

    Joe, if I understand correctly, you're using that function by itself, not as a shim for WPFBOGP. Could a variation of that potentially be used in tandem with WPFBOGP to solve this issue? (My custom-function-fu is weak, so I'm not sure if that's possible or not.)

  3. Joe Manna
    Member
    Posted 1 year ago #

    I came up with a solution.

    After much tinkering, I was able to grab the Thesis Post Image and pass it through the WPFBOGP plugin as desired. As far as I can tell, this doesn't have any adverse effects.

    OLD CODE SNIPPET:

    if ( ! is_home() && $options['wpfbogp_force_fallback'] != 1 ) {
    			// Find featured thumbnail of the current post/page
    			if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( $post->ID ) ) {
    				$thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
    				$wpfbogp_images[] = $thumbnail_src[0]; // Add to images array
    			}

    MODIFIED CODE SNIPPET:

    if ( ! is_home() && $options['wpfbogp_force_fallback'] != 1 ) {
    
    			// Checks for existing post images used in DIYThemes' Thesis 1.8.x
                            if ( function_exists( 'thesis_post_image_info' ) ) {
    				$post_image = thesis_post_image_info('image');
    				 $thumbnail_src = $post_image['url'];
    				$wpfbogp_images[] = $thumbnail_src;
    
                            }
    
    			// Find featured thumbnail of the current post/page
    			if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( $post->ID ) ) {
    			 $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
    
                            $wpfbogp_images[] = $thumbnail_src[1]; // Add to images array; edited to "1", original: "0"
    			}

    It would be cool to add a little checkbox that says "Using Thesis 1.8.x?" and it would adopt this logic.

    However, something to keep in mind, this is *temporary* as updates may overwrite the changes. I'm hoping to see some logic around selecting or detecting Thesis as a theme framework in the future.

    As far as I can tell, Thesis 2.x is utilizes "wp_attached_file" the way that is intended (and already supported by WPFBOGP).

    -Joe

  4. sergeliatko
    Member
    Posted 1 year ago #

    Hi for thesis 2 you may use this box which gives you more control over how wp featured image is displayed : http://thesisimage.com/

    for thesis 1.8.x you have this plugin to insert featured image url into thesis post image custom fields : http://thesistut.com/store/wordpress-featured-image-thesis/

    feel free to contact me from those websites if you have further questions

  5. Chuck Reynolds
    Member
    Plugin Author

    Posted 1 year ago #

    you guys try the beta linked in the pinned post at the top of this support forum?

    I need more testers on Thesis anyways.. lmk

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic