designinfantry
Member
Posted 2 years ago #
<?php
global $id;
$mytitle = the_title();
echo '<a href="http://twitter.com/home?status=' . $mytitle . get_bloginfo('url') .
'/?p=' . $id . '%20RT%20@nullweknow' . '" title="Tweet">Tweet</a>';
?>
I want to retweet the title, but the above var doesn't parse the_title() as a url. Can someone help?
the_title needs to be used in the loop
try
http://codex.wordpress.org/Template_Tags/get_the_title
which returns a string and takes the ID which you seem to have as a global variable.
designinfantry
Member
Posted 2 years ago #
<?php
global $id;
echo $title;
echo '<a href="http://twitter.com/home?status=' . get_the_title($id) . '%20' . get_bloginfo('url') .
'/?p=' . $id . '%20RT%20@nullweknow' . '" title="Tweet" target="_blank">Tweet</a>';
?>
Amazing. Works like a charm.