0

I want to add one more field like this, I copied and paste this code. It's gave me one more field, but when I edit first field and publish my post, second field is gating same inserted. enter image description here

<div class="Blkcn TrailerBx"> 
    <label> 
        <span class="Title"><?php _e('Trailer', TRMOVIES); ?><i class="dashicons dashicons-format-video"></i></span> 
        <textarea class="txtara" name="trailer" placeholder="<?php _e('Insert code iframe here', TRMOVIES); ?>">
            <?php 
            if( isset( $_POST['trailer'] ) and empty($ok) ) { 
                echo stripslashes( $_POST['trailer'] ); 
            }
            elseif( get_post_meta($post->ID, TR_MOVIES_FIELD_TRAILER, true)!='' ) {
                echo stripslashes( get_post_meta($post->ID, TR_MOVIES_FIELD_TRAILER, true) ); 
            } ?>
        </textarea> 
    </label> 
</div>
  • 1
    Did you change the name of the field from trailer to something else in the duplicated code? Did you do the same with the TR_MOVIES_FIELD_TRAILER custom field? – nmr Apr 12 at 22:22
  • @nmr thanx for advice, it's works perfectly now. – jowan Apr 13 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.