WordPress.org

Ready to get started?Download WordPress

Forums

https link in custom fields using front end editor (1 post)

  1. iffifan
    Member
    Posted 1 year ago #

    Hi,

    I'm new to wordpress.
    I am using custom fields in front end editor to make posts. Whenever i enter a link with https protocol it automatically adds http protocol before https and "https://www.facebook.com" BECOMES "http://https://www.facebook.com" in post.

    Custom field code in front end editor:

    <input type="text" name="website" id="website" class="textfield" value="<?php echo esc_attr(stripslashes($website)); ?>" size="25"  />

    $website is custom field

    code for retrieving custom field value in post:

    <a href="<?php echo get_post_meta($post->ID,'website',true);?>" target="_blank">Some Text</a>

Topic Closed

This topic has been closed to new replies.

About this Topic