Page 1 of 1

PHP concatenation problem

Posted: Tue Sep 09, 2014 8:11 am
by someguyhere
I think this is a concatenation problem...below is my code (used inside Wordpress) but the echo spits out the variable in front of the opening </li>. Am I doing something wrong here?

Code: Select all

					if ( isset ( $fbloop ) && $fbloop ) {
						echo '<li class="facebook"><div class="fb-like" data-href="' . the_permalink() . '" data-send="false" data-layout="button_count" data-width="47" data-show-faces="false" data-font="arial"></div></li>';
					}
Here is the output:
http://spartanmedia.com/use-twitter-like-pro/<li class="facebook"><div class="fb-like" data-href="" data-send="false" data-layout="button_count" data-width="47" data-show-faces="false" data-font="arial"></div></li>

Re: PHP concatenation problem

Posted: Tue Sep 09, 2014 8:15 am
by Celauran
WordPress functions echo instead of returning half the time. Try using get_permalink instead of the_permalink.

Re: PHP concatenation problem

Posted: Tue Sep 09, 2014 9:37 am
by someguyhere
Perfect. Thanks!