So I've built the usual CMS site in wordpress, which all works great, no problems. I'm using custom post types, but this time round instead of each post taking you to a new page, I've set up a masonry grid layout full of thumbnails, clicking one of the thumbnails appends the relevant content to a clearing div (after every row) and attached a hashchange function to the url (so you can navigate to it from another page.
But, this is where my problem lies, as the urls have hashes in, and I'm having a tweet button for every post so users can share it via twitter etc, when it appends the url to a tweet it strips out all the content after the hash, which isn't useful in this case.
Example of my post url's: \[code\]www.example.com/post-type/#post_01\[/code\]
HTML / PHP code:\[code\]<a href="https://twitter.com/share?url=<?php echo home_url(); ?>/post-type/#<?php echo strtolower(str_replace(' ', '_', get_the_title())); ?>&text=TWEET TEXT GOES HERE" target="_blank">Tweet</a>\[/code\]This should append the post url to the tweet as follows: \[code\]www.example.com/post-type/#post_01\[/code\]but instead the hash and everything following it (including the tweet text) is being stripped out.
Is there anyway round this? Thus allowing you to tweet about links with hashes in the url?
But, this is where my problem lies, as the urls have hashes in, and I'm having a tweet button for every post so users can share it via twitter etc, when it appends the url to a tweet it strips out all the content after the hash, which isn't useful in this case.
Example of my post url's: \[code\]www.example.com/post-type/#post_01\[/code\]
HTML / PHP code:\[code\]<a href="https://twitter.com/share?url=<?php echo home_url(); ?>/post-type/#<?php echo strtolower(str_replace(' ', '_', get_the_title())); ?>&text=TWEET TEXT GOES HERE" target="_blank">Tweet</a>\[/code\]This should append the post url to the tweet as follows: \[code\]www.example.com/post-type/#post_01\[/code\]but instead the hash and everything following it (including the tweet text) is being stripped out.
Is there anyway round this? Thus allowing you to tweet about links with hashes in the url?