views:

10

answers:

1

Hi

I am using the 'twitter for wordpress' plugin to display the last tweet in wordpress. it works fine but needs the username for the twitter account harcoded into the line of code:

<?php 


      twitter_messages('myaccount', 1, false, false, false, true, true, false); 
?>

What im trying to do is replace 'myaccount' with a variable but it doesnt seem to like it. Im getting the variable I want from another function and works fine but tryin to put it into the twitter code wont work:

<?php 
      $twitter = contact_detail('twitter');

      twitter_messages("'".$twitter."'", 1, false, false, false, true, true, false); 
?>

At first the function producing the variable was echoing the value but iv changed it to return it but it has not helped.

Any ideas? Thanks!

+1  A: 

Don't do that. You don't need the double quotes. Just say

twitter_messages($twitter, 1, false, false, false, true, true, false);
Josh K
cheers, tried that but the account name seems to need quotes around it eg 'myaccount'
Paul Elliot
@Paul: It really shouldn't. The only reason it would need that is if you weren't getting a string back from `contact_details`. Then you could use `$twitter.""`. It should handle the type difference internally though.
Josh K