The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Inserting URL's in Custom Field Values (3 posts)

  1. davidzupec
    Posted 5 years ago #

    Hello, below is a static url code that's on my page as an example. What I want to do is make it dynamic so that I can input any website address as a value in my custom field and it'll show up as a clickable link on my page. Not sure how to echo this out:

    <p><a href="www.ultrashine.com">UltraShine.com</a></p> 
    My custom field Name is <strong>client</strong> and the Value I put is <strong>www.ultrashine.com</strong>
    I tried this:
    <p><?php echo get_post_meta($post->ID, 'client', true); ?></p>

    and it returned this: http://www.ultrashine.com (nothing clickable)

    Thank you

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    <p><a href="<?php echo get_post_meta($post->ID, 'client', true); ?>"><?php echo get_post_meta($post->ID, 'client', true); ?></a></p>

  3. davidzupec
    Posted 5 years ago #

    It Works!!! Thank you so much esmi, I've been tackling this all morning : )


Topic Closed

This topic has been closed to new replies.

About this Topic