"the permalink" – how do I shorten / truncate / substr it before output
-
Hi.
I have a real hard time shortening the_permalink.
I know that the_permalink outputs straight away, but I’ve tried building a plugin to shorten it. I’ve also tried all kinds of substring tricks. But to no avail.
What I want to do is grab the link to a story that is pulled via rss and shorten that link from:
https://example.com/i-have-a-real-hard-time-shortening-the-bloody-permalink
to:
https://example.com/i-have-a-real-%5B…%5D
or maybe even – if I get that far – to throw some code at it so it only outputs https://example.comIs it in anyway possible to grab it before it outputs or is there a way to grab it and write it to a custom field and then pull it from there?
Thanks in advance.
- The topic ‘"the permalink" – how do I shorten / truncate / substr it before output’ is closed to new replies.