Output URL as page title instead of full web address

Support General Output URL as page title instead of full web address

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #6878
    janekjanek
    Participant

    Good morning,

    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?

    #6882
    Truong GiangTruong Giang
    Participant

    Hi there,

    I haven't got fully your problem. Can you describe more detail?

    #6884
    janekjanek
    Participant

    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

    http://imgur.com/a/GQGhx

    Hopefully this is clear. Let me know if you need to know more.

    #6886
    Truong GiangTruong Giang
    Participant

    Hi,

    Why don't you use another field for user to fill the page title?

    #6888
    janekjanek
    Participant

    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:
    https://a15e3113.ngrok.io/academy-sports/tennis/

    #6905
    Truong GiangTruong Giang
    Participant

    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

    #6907
    janekjanek
    Participant

    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.

    #6908
    Truong GiangTruong Giang
    Participant

    This is WordPress Shortcode API documentation: https://codex.wordpress.org/Shortcode_API
    I hope it's helpful for you.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.