Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Member lew1s's Avatar
    Join Date
    Oct 2013
    Posts
    65
    Member #
    37371
    Liked
    2 times

    show single custom field

    can you help me how to show single custom field?

    my functions.php
    $wpas->addCustomField( 'individual', array( 'id' => 'individual', 'label' => 'Name of Individual', 'required' => true, 'callback' => 'wpas_my_custom_field' ) );

    my file :
    <div class="wpas-individual"><span class="details-title">Name of Individual: </span><?php echo get_post_meta($post->ID, 'individual', true); ?>


    its not showing at all, but when i use <?php the_meta(); ?> it show all custom fields. what i am doing wrong ?

  2.  

  3. #2
    Junior Member
    Join Date
    Mar 2014
    Posts
    1
    Member #
    38809
    Just need to ask to make sure...That file where you call the post meta, is that inside the loop?

    The next thing I would say is to see how the variable is being stored. From what you are saying, the code you provide should work, so I would verify that the post meta is being stored by the "individual" key. Since I don't know what $wpas is for, technically, your post meta could be inside of another field, so instead of it being "individual", it could be stored in "wpas-individual".

    Look at wpas_my_custom_field function to see how it's saving your post meta.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Tags for this Thread

All times are GMT -6. The time now is 05:10 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com