I'm trying to setup a URL metabox on the backend of WordPress that allows the user to input multiple URL addresses that then appear on the front end using a shortcode within a html widget. This works fine for displaying the web address however I'd like it to display page title instead. For instance if one of the URLs linked to a youtube video I'd prefer the youtube video/page title to be listed on the front end instead of the full web address.
Is there a simple way to do this or would to require a lot of coding?
I haven't got fully your problem. Can you describe more detail?
So basically I'd like links to display a page title instead of the full url.
For instance if I put http://www.google.com in as URL it would be better if it displayed as Google (page title) instead of the url.
I've attached a imgur gallery showing what I have set up on the backend and frontend
Hopefully this is clear. Let me know if you need to know more.
Why don't you use another field for user to fill the page title?
Is there a way to do this and have that page title override the full web address? For instance the user inputs the url "http://www.google.com" and the page title as "Google" then on the front end it just displays the url as "Google".
I mainly want to do this to provide a better experience for visitors and minimise the clutter while also making it easy for an author in the back end to add a list of URLs to the page sidebar.
See link for example of the sidebar in action:
I think you must create a new shortcode to turn a url to the format you want. I hope this link can help you: https://stackoverflow.com/questions/4348912/get-title-of-website-via-link
Pretty much exactly what I want. I'll have to ask about StackOverlow and see if someone can help me implement it with the short code.
This is WordPress Shortcode API documentation: https://codex.wordpress.org/Shortcode_API
I hope it's helpful for you.