I have an issue. I have a piece of sharing code which I created for social media.
<a href="http://twitter.com/home?status=<?php the_title(); ?>.<?php the_permalink();?>" class="twitter">
Now when I run this through the W3 Validator it says there shouldn't be a space. Now when I looked at the code it was outputting the title DOES have spaces in it.
How do I sanitize this title to add in dashes within my url?
I just want the title to add dashes in this context only. I have looked at the sanitize_title function and the_title_attribute function in the Wordpress Codex but don't really know how to make it work in this situation. I am sure there is a simple solution. Any help would be great.