WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. davidzupec
    Member
    Posted 4 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:

    <h3>Client</h3>
    <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:
    <h3>Client</h3>
    <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 4 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
    Member
    Posted 4 years ago #

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

    David

Topic Closed

This topic has been closed to new replies.

About this Topic