I have this twitter share button that pulls 100 characters from the content of the post and its URL for the twitter share.
<a class="popup"
href="http://twitter.com/share?url=<?php
echo urlencode(get_permalink($post->ID));
?>&text=<?php the_content_limit(100, "");?>">
<img src="http://zitatezumnachdenken.com/wp-content/uploads/2013/04/twittersmall.png" alt="twitter">
</a>
It’s working but I always get the following validation error
Can someone help me?
You are sending
text
unencoded.urlencode
that just like you do the permalink.Although,
the_content_limit
looks like it probablyecho
s (based on your usage) instead of returning a string, which you will need. So I expect you will have to find that function and alter it or duplicate it or find some other alternative to get a string that you can encode.Regarding your comment: