WordPress.org

Forums

[resolved] Outputting custom field in plain text (5 posts)

  1. studioburst
    Member
    Posted 3 years ago #

    I'm trying to output the contents of a custom field in plain text, the custom field contains a standard youtube embed code, which is shown at the top of the post without problem, but I also want to add the embed code being used in plain text (so others can copy/paste it).

    To output the playable video I'm using:

    <?php echo get_post_meta($post->ID, "video", true); ?>

    I've tinkered for a few hours now and can't get the embed code to be shown in plain text (in a small iframe).

    Anyone point me in the right direction please?

  2. adpawl
    Member
    Posted 3 years ago #

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    <span class="metalink">Link:
    <input type='text' value='<?php echo get_post_meta($post->ID, "video", true); ?>' onclick='this.focus(); this.select();' />
    </span>

    Does something like this work? I use it to output my shortlink at the bottom of each post....

  4. studioburst
    Member
    Posted 3 years ago #

    Awesome, the specialchars link helped me get closer to my aim, but the second reply from Rev. Voodoo worked perfectly.

    Thank you so much.

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Cool, I'm glad that worked out for you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.