how to echo the page title replacing the 's with
-
1. I’m working with an existing addthis script and I cannot edit the original addthis.js
2. all the other buttons work, except the facebook. it still shares the link, but the page title will not print.
3. if I was to install the plugin, it would require more customization that I have time for. plus, all custom code would be overwritten with the first update.
4. it looks like the facebook button doesn’t work because the title is not passing correctly.
BAD (what my site is making):
https://api.addthis.com/oexchange/0.8/forward/facebook/offer?username=myusername&url=https://mywebsite.com/2012/07/17/hello-world/&title=Hello%20world!GOOD (what the original site was making):
https://api.addthis.com/oexchange/0.8/forward/facebook/offer?username=myusername&url=https://https://mywebsite.com/get-help-now/index.html&title=Get+Help+Nowthe second URL is from another site that I did not work on. it works (with the correct url and username).
as far as I can tell from going through the codex, is there are many ways to call a page title. do any of them echo the page title replacing the %20’s with +?
see my link code below:
<li class="facebook"> <a shape="rect" target="_blank" href="https://api.addthis.com/oexchange/0.8/forward/facebook/offer?username=myusername&url=<?php echo curPageURL(); ?>&title=<?php echo get_the_title(); ?>" class="APEdocument APEexternal"><img src="https://mywebsite.com/images/sys_images/addthis/toolbar-fb-top.png" alt="Facebook Icon" title="Facebook Icon, opens in new window"> </a> </li>
hopefully, I won’t have to completely start over on this one. like I said, everything else works.
- The topic ‘how to echo the page title replacing the 's with’ is closed to new replies.