WordPress.org

Forums

More Fields
is it possible: if has field, els, show another ? (4 posts)

  1. roycegracie
    Member
    Posted 2 years ago #

    hi.. is it possible to use "if" on this plugin ?

    i want to do somthing like that:

    if my client filled a certain filled - show it,
    if he didn't and filled another field - show that one.

    http://wordpress.org/extend/plugins/more-fields/

  2. Danno040
    Member
    Posted 2 years ago #

    I've done stuff like this in the past:

    <?php $custom_field = get_post_meta($post->ID, 'custom_field', true); ?>
      <?php if(trim($custom_field) != '') { ?>
        <p><?php $custom_field ?></p>
      <?php } else { ?>
        <p>No custom field set</p>
      <?php } ?>
  3. roycegracie
    Member
    Posted 2 years ago #

    that is great !

  4. danrmejia
    Member
    Posted 2 years ago #

    Very good one, been strugling with isset() and empty() and it didn't work that way. Thanks!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • More Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.