I want to share a wordpress post on twitter. I'm using this :
<a href="https://twitter.com/share?url=<?php the_permalink() ?>&text=<?php the_title() ?>&via=<?php the_author() ?>&hashtags=<?php the_tags('', '') ?>" ></a>
My problem is that
the_tags() prints the tags inside the
<a> tag. How can I use
the_tags('', '') ( which separates the tags with comma as the hashtag needs to be ) for twitter hashtags ?
I would appreciate any solutions without the use of a plugin