Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Forum How-To (http://forum.bytesforall.com/forumdisplay.php?f=9)
-   -   [SOLVED] ADD This only on Single Posts (http://forum.bytesforall.com/showthread.php?t=7317)

Jurgen Estanislao May 28, 2010 05:24 AM

[SOLVED] ADD This only on Single Posts
 
Hi Flynn, JuggleDad, Guys!

I now know how to embed sharing functionalities on my blog. However, how do I indicate it on the LOOP that it should only come out on post/article pages?

Thanks!

juggledad May 28, 2010 05:38 AM

surround it with an
HTML Code:

<?php if (is_single() {
...other code goes here
} ?>


Jurgen Estanislao May 28, 2010 11:35 AM

Hi Juggledad! and Larry!

Thanks for your tips, I've tried both but they didn't work.

For my sharing functions here's my code:

--
<br/>
<br/>
<i>Sharing is Caring!</i>
<br/>
<br/>
<div class="addthis_toolbox addthis_default_style">
<a class="addthis_button_googlebuzz"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Google-Buzz.png/" alt="Google Buzz" title="Buzz This!"/></a>
<a class="addthis_button_facebook"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Facebook.png/" alt="Facebook" title="Share This!"/></a>
<a class="addthis_button_twitter"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Twitter.png/" alt="Twitter" title="Tweet This!"/></a>
<a class="addthis_button_digg"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Digg.png/" alt="Digg" title="Digg This!"/></a>
<a class="addthis_button_delicious"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Delicious.png/" alt="Delicious" title="Send to Delicious!"/></a>
<a class="addthis_button_stumbleupon"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/stumbleupon.png/" alt="StumbleUpon" title="Send to StumbleUpon!"/></a>
<a class="addthis_button_reddit"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Reddit.png/" alt="Reddit" title="Send to Reddit!"/></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=jurgenestanislao"></script>
<br/>
<br/>

For Disqus, not sure particularly where to edit this.

Thanks for your support guys!

juggledad May 28, 2010 01:24 PM

I broke this into two threads to keep things clean
the descus thread is http://forum.bytesforall.com/showthread.php?t=7323

Where are you putting all this share this code? In your initial post you said the LOOP so I assume (forgive me for that) that you ment in the ato->Style & edit CENTER COLUMN->the LOOP - is that correct or do you put is somewhere else??

Jurgen Estanislao May 28, 2010 09:33 PM

Hi JuggleDad,

Yes, you're right. I placed this code on ATO > Style Center Column > The Loop.

In any case, is that the right section to place such code? Problem is the buttons display on all pages. I'm just interested to display the share functions on single blog/article pages.

Thanks

juggledad May 28, 2010 09:52 PM

Did you put the code I showed exactly, because it wouldn't work as is, it would only work if you were using php code. Your sample shows HTML code so you would need a ' ?>' at the end of the first line of code I gave and a '<?php ' at the beginning of the last line I gave you

Jurgen Estanislao May 28, 2010 10:21 PM

Hi Juggledad!

Sorry that I'm not that great with coding. :)

In any case, is this correct?

<?php /* For ADD THIS share functionalities on single posts */
if (is_single() { ?>
--
<br/>
<br/>
<i>Sharing is Caring!</i>
<br/>
<br/>
<div class="addthis_toolbox addthis_default_style">
<a class="addthis_button_googlebuzz"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Google-Buzz.png/" alt="Google Buzz" title="Buzz This!"/></a>
<a class="addthis_button_facebook"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Facebook.png/" alt="Facebook" title="Share This!"/></a>
<a class="addthis_button_twitter"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Twitter.png/" alt="Twitter" title="Tweet This!"/></a>
<a class="addthis_button_digg"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Digg.png/" alt="Digg" title="Digg This!"/></a>
<a class="addthis_button_delicious"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Delicious.png/" alt="Delicious" title="Send to Delicious!"/></a>
<a class="addthis_button_stumbleupon"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/stumbleupon.png/" alt="StumbleUpon" title="Send to StumbleUpon!"/></a>
<a class="addthis_button_reddit"><img src="http://www.seotaoist.com/wp-content/uploads/2010/05/Reddit.png/" alt="Reddit" title="Send to Reddit!"/></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=jurgenestanislao"></script>
<br/>
<br/>
<?php } ?>

juggledad May 29, 2010 07:00 AM

That looks good, just get rid of teh line with the two dashes after the if statement or they will show up on the page

Jurgen Estanislao May 29, 2010 08:26 AM

Hi Juggledad,

That's my problem. This code I shared doesn't work.

:(

Jurgen Estanislao May 29, 2010 08:52 AM

On second thought, it now works!

Jurgen Estanislao May 29, 2010 09:03 AM

Thanks Juggledad!

juggledad May 29, 2010 09:59 AM

the if has an error it should be
HTML Code:

if (is_single()) { ?>

Jurgen Estanislao May 29, 2010 10:17 AM

Yeah I figured that out! Thanks so much for you help Juggledad!


All times are GMT -6. The time now is 12:30 AM.

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