Buying Can someone please help me with this code?

Discussion in 'Programming' started by Divvy, Oct 19, 2011.

  1. #1
    Hello friends,

    Im looking for someone that could help me with a little code in my wordpress website...
    My website: www.estapessoa.com
    Theme: Gallery from UpThemes

    Please visit my website, when you pass with your mouse over an image, you will see the post title below.
    I want to replace that (title) with a facebook share button.

    I already have the facebook code, only need help adding the code :)

    Please take a look at the code:
    <div id="post-<?php the_ID() ?>" <?php echo post_class($vidclass); ?>>
    			<div class="entry-content">
    			<?php childtheme_post_header() ?>
            	<a href="<?php echo the_permalink() ?>">
            	<span class="slide-title"><?php echo the_title(); ?></span>
            	<?php 
    			
    			$thumbnail = get_post_meta($post->ID, 'thumbnail', true);
    			
    			if( $thumbnail ):
    				echo '<img class="attachment-thumbnail" src="' .get_post_meta($post->ID, 'thumbnail', true) . '" width="125" height="125" alt="' . get_the_title() .'" /></a>';
            	elseif( has_post_thumbnail() ): 
            		the_post_thumbnail('thumbnail');
            	else:
    				echo '<img class="attachment-thumbnail" src="' . get_bloginfo('stylesheet_directory') . '/images/thumbnail-default.jpg" width="125" height="125" alt="' . get_the_title() .'" />';	        	
            	endif;
            	?>
            	</a>
    		  </div>
    		</div><!-- .post -->
    Code (markup):
    This is the code line that makes the title appear:
    <span class="slide-title"><?php echo the_title(); ?></span>
    Code (markup):
    Can someone please help me?

    I tried to replaced with this:
    <span class="slide-title"><a name="fb_share"></a> 
    <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" 
            type="text/javascript">
    </script></span>
    Code (markup):
    But didnt work...

    Also tried this wordpress plugin but got same problem:
    http://wordpress.org/extend/plugins/facebook-share-new/

    I need this working at 100% (facebook share integration) with showing the correct image thumbs, website title and description.

    Can someone please help me? I can pay you via paypal
    Thank you!
     
    Divvy, Oct 19, 2011 IP
  2. ryandanielt

    ryandanielt Well-Known Member

    Messages:
    1,797
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    185
    As Seller:
    100% - 2
    As Buyer:
    100% - 0
    #2
    Your first problem might be the fact that you are just calling an external page "<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>" I am sure that is your main problem that you need to call that at the top of the page and then call the function that displays the button!
     
    ryandanielt, Oct 19, 2011 IP
  3. tiamak

    tiamak Active Member

    Messages:
    81
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    58
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    LOL man you have just made a typo (or that script for mouseover effect just made mess with your code)
    because in your websites source code there is:
    which is obviously broken code

    btw as ryandanielt explained
    no need to call <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> for each button - it is enough to call it once for example somewhere above buttons
     
    tiamak, Oct 20, 2011 IP
  4. jcwebhole

    jcwebhole Active Member

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    i think you got it right....
    check this out from facebook http://developers.facebook.com/docs/share/
    you might also consider adding extra meta tags so that you can be sure about the facebook sharing title, description, and link image...
    then since there i believe are different pages in your site then you might aswell define those pages in the button declaration since currently it will just default to your main site... (e.g. if I click a share button - it will share http://www.estapessoa.com/ rather than the target page) refer to the codes that you have now.

    you might also try to dynamically change that span via jquery... just thinking of other options... your code seems ok to me unless you got some conflicts somewhere else
     
    jcwebhole, Oct 20, 2011 IP
  5. ryandanielt

    ryandanielt Well-Known Member

    Messages:
    1,797
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    185
    As Seller:
    100% - 2
    As Buyer:
    100% - 0
    #5

    I am sorry but perhaps you should read carefully the information described on the "facebook share button page" that you included the link to before you make a comment. Not trying to be rude or anything but it just points people in the wrong direction.

    As I quote from the OFFICIAL facebook share button page:

    "You need to include the script tag only once, no matter how many Share buttons you put on the same page. Place it after the first anchor tag on the page. If you can't place it there, you should put it high up on the page to ensure fast loading (in the page head works well)."


    To the creator of this post, please refer to google, there are many ways to include a share button for facebook on your page and the main way when you wish to include many is to include the main code at the top of your page and then call facebook javascript variables which when done right you can set the title and page url for each button.
     
    ryandanielt, Oct 20, 2011 IP