Skip to content
WJunction - Webmaster Forum

Can someone please help me with this code?

Status
Not open for further replies.

Divvy

Experienced Member
806
2009
18
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:
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 -->

This is the code line that makes the title appear:
Code:
<span class="slide-title"><?php echo the_title(); ?></span>

Can someone please help me?

I tried to replaced with this:
Code:
<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>

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!
 

2 comments

use the facebook iframe code instead like this:


<span class="slide-title"><iframe src="//www.facebook.com/plugins************ href=<?php echo the_permalink() ?>&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=35&amp;appId=162934820440170" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe></span>

Sorry with the ****** its censored you can get the iframe code from here: http://developers.facebook.com/docs/reference/plugins/like/

but if you want to use your current code u missed out this:

<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=162934820440170";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

^^ Put that in the header or body.
 
Status
Not open for further replies.

About the author

D
Experienced Member · Joined
806
Messages
18
Reactions
18
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom