Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Can Atahualpa do this? Define the image for Facebook links?


  #1  
Old Dec 2, 2009, 12:08 AM
adum's Avatar
adum
 
85 posts · Jun 2009
I found this guide intriguing, but it's intended for Thesis:

http://www.wolf-howl.com/blogs/thesis-digg-facebook/

Is there a way to do this with Atahualpa? It's basically a way to tell Facebook and Digg what image to use when you post a link from your site to them.

I am guessing you would have use a custom field with the URL of the image you want, but I am not exactly sure how to do this using Atahualpa "language" and every time I've tried to edit the functions of Atahualpa it crashes.

Last edited by adum; Dec 7, 2009 at 11:01 AM.
  #2  
Old Dec 7, 2009, 12:08 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Yes, add the code to functions.php

PHP Code:
function get_social_img() {
    global $post;
    if ( is_single ()){
       $image = get_post_meta($post->ID, 'title_of_your_custom_field', $single = true);
       ?>
       <link rel="image_src" href="<?php echo $image?>" />
       <?
    
}
}
add_action('wp_head''get_social_img');
You could also automate this without custom fields

PHP Code:
function get_social_img() {
    global $post;
    if ( is_single ()){
      $image = "http://www.yoursite.com/socialimages/".$post->ID.".jpg";
       ?>
      <link rel="image_src" href="<?php echo $image?>" />
       <?
      
}
}
add_action('wp_head''get_social_img');
This would print

HTML Code:
<link rel="image_src" href="http://www.yoursite.com/socialimages/17.jpg" />
on the single post page of the post with the ID #17

You'd put the images into yoursite.com/socialimages/
  #3  
Old Dec 8, 2009, 02:03 PM
adum's Avatar
adum
 
85 posts · Jun 2009
Thanks so much Flynn, it works perfectly.

Do you know if there it a way to automatically detect the first image within a post, or would that be really complicated? Just curious, don't feel obligated to come up with anything because it's working awesome right now. I'm so happy.
  #4  
Old Apr 14, 2010, 09:52 AM
anthonyportal
 
4 posts · Apr 2010
Hi
May i know , does the code above work for other wordpress themes.


Thank you.
Best regards
Anthony

  #5  
Old Apr 14, 2010, 01:43 PM
viewdesigninc
 
35 posts · Mar 2009
I'd like to control the thumbnail for just the homepage link in Facebook.

Also, where in functions.php does the code snippet above get inserted?
  #6  
Old Apr 15, 2010, 01:44 PM
anthonyportal
 
4 posts · Apr 2010
Hi

I already try the mentioned code in my php.admin.


I do change the code as below, please let me know am i correct to change this. now there is no image for facebook thumbnail at all.

Code:
function get_social_img() {
    global $post;
    if ( is_single ()){
      $image = "http://mysite.com/wp-content/uploads/".$post->ID.".jpg";
       ?>
      <link rel="image_src" href="<?php echo $image; ?>" />
       <?
      }
}
add_action('wp_head', 'get_social_img');

thank you.

Last edited by anthonyportal; Apr 15, 2010 at 01:46 PM.
  #7  
Old Apr 15, 2010, 01:55 PM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
lets say you were on post 22, that code will be looking for a image called "http://mysite.com/wp-content/uploads/22.jpg"

do you have that image?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #8  
Old Apr 15, 2010, 10:38 PM
anthonyportal
 
4 posts · Apr 2010
HI juggledad,


Although i have upload it to my uploads folder, but it still show no thumbnail.

May i check with you the code that i change in bold blue , it that correct.?

thank you
  #9  
Old Apr 16, 2010, 07:25 AM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
I think that is the correct place to change - you did put in your domain name right?
what version of atahualpa and WP?
What is your url?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #10  
Old Apr 17, 2010, 12:11 AM
anthonyportal
 
4 posts · Apr 2010
HI juggledad,


First thank you for this information, i not sure what i do now is working fine.

Thank again ... juggledad

I have a another meta tag issue.
Which is meta tag for Flash video

Do you mind to share what is the coding for Flash embedded.

I found some extra information on Flash embedded code. but i not too sure how to coding it for my wordpress blog.

http://wiki.developers.facebook.com/...ying_Meta_Tags

Thank you.
  #11  
Old Apr 25, 2010, 06:49 PM
adum's Avatar
adum
 
85 posts · Jun 2009
The above code I had posted was wrong...it was missing something.

This is what I use now that works:

// facebook connect digg social media image
function get_social_img() {
global $post;
if ( is_single ()){
$image = "";
$image = get_post_meta($post->ID, 'Thumbnail', $single = true);
?>
<link rel="image_src" href="<?php echo $image; ?>" />
<?
}
else {
?>
<link rel="image_src" href="http://www.sixprizes.com/images/6P.gif" />
<?
}
}
  #12  
Old Jun 21, 2010, 01:14 PM
jdadour
 
7 posts · Dec 2009
I am having a similar issue with Facebook showing my Header images as thumbnails instead of the image in the associated post. Would some code like this work? where it looks for the image attached in the post?

Code:
function get_social_img() {
global $post;
if ( is_single ()){
$image = wp_get_attachment_image($attachment_id, $size='full', $icon = false);
       ?>
      <link rel="image_src" href="<?php echo $image; ?>" />
       <?
}
}
add_action('wp_head', 'get_social_img');
  #13  
Old Aug 4, 2010, 02:26 PM
wadams92101's Avatar
wadams92101
 
46 posts · May 2010
I tried the second code block posted by Flynn, without success. I made sure that it referenced my domain. Am I missing something obvious? (I'm a newbie so sometimes it goes over my head) Do I need to make sure the image is named the number of the post for it to work?
  #14  
Old Aug 5, 2010, 06:53 AM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
wadams92101 - did you try the code from post 11
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #15  
Old Sep 18, 2010, 10:16 AM
genevieve.r.thompson
 
21 posts · Aug 2010
Hi. I've tried several of these codes on my site, and am not having luck. Whenever you click the Facebook Like button at the end of my posts, for some reason, the Twitter Logo shows up as the featured image for all my posts -- whether my post contains an image or not.

My site is www.genwithag.com
My theme is ATO 3.4.9
WP 3.0.1

Can someone walk me through how I might rectify this?

thanks
Gen

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share Post on FaceBook without any use of plugins (( Atahualpa )) irvin Atahualpa 3 Wordpress theme 5 Dec 18, 2010 07:04 AM
Facebook Badge winemuse Sidebars & Widgets 4 Nov 20, 2009 01:34 AM
Problems With Facebook Sharing iLeonardo Post-Kicker, -Byline & -Footer 6 Oct 7, 2009 03:00 AM
Is Facebook Profitable? Ahsen New Versions, & Updating 1 Jul 7, 2009 08:10 AM
Difficulties to define a navigation estructure ahc Page & Category Menu Bars 0 Jun 8, 2009 10:21 AM


All times are GMT -6. The time now is 03:49 AM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.