How to insert link's domain name in plain text after a hyperlink?

hekjazaja

New Member
Is there a way to automatically insert link's domain name after that link? I want to see this: \[code\]A link to youtube video [youtube.com]\[/code\]I'd prefer to use HTML and CSS only, but I guess that's not possible. The idea was using this code:\[code\] a:after { content: " [" attr(href) "]"; }\[/code\]But that of course displays the whole URL:\[code\]A link to youtube video [https://www.youtube.com/watch?v=asdfghi00]\[/code\]And I consider that too long and unnecessary. I use Wordpress (maybe there's just a plugin for doing this and I just haven't seen it). It links jQuery, so a jquery script is probably acceptable. Alternatively I could use PHP and hack it into Wordpress.What solution do you consider the best? PHP or Javascript? Will I benefit from using jQuery (well, it's loaded anyway)? If possible, could you write this snippet for me? Thanks.
 
Back
Top