Custom Fields
Re-Envisioned
Support General Output URL as page title instead of full web address

This topic contains 7 replies, has 2 voices, and was last updated by  Truong Giang 1 year, 9 months ago.

  • Creator
    Topic
  • #6878

    janek
    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?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #6882

    Truong Giang
    Participant

    Hi there,

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

    #6884

    janek
    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

    View post on imgur.com

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

    #6886

    Truong Giang
    Participant

    Hi,

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

    #6888

    janek
    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 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

    janek
    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 Giang
    Participant

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

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.