WordPress.org

Ready to get started?Download WordPress

Forums

[plugin: More Fields] how to check if the custom field is empty (1 post)

  1. johnirsk8r
    Member
    Posted 1 year ago #

    0 down vote favorite

    Ok I have a drop down box and I'm using the more fields plugin for word press to print out a http:// address that is entered on the post screen. The more fields plugin gives this code to print out the custom text field.

    <?php meta('guys'); ?>

    I need to check the custom fields to see if a address has been entered. If one has been entered it will show the in the drop down if not it will not show it. here is my code.

    <form name="jump" >
    <p align="left">
    <select name="menu" style="width: 260px;">
    <?php if(class_exists( 'guys') && meta('guys')) :?>
    <option value="<?php echo meta('guys'); ?>">GUYS</option>
    <?php endif; ?>
    <?php if(class_exists( 'girls') && meta('girls')) :?>
    <option value="<?php echo meta('girls'); ?>">Girls</option>
    <?php endif; ?>
    <?php if(class_exists( 'other') && meta('other')) :?>
    <option value="<?php echo meta('other'); ?>">GUYS AND GIRLS</option>
    <?php endif; ?>
    </select>
    <input type="button" onClick="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO" style="padding: 0px 5px;">
    </p>
    </form>

    for some reason its not working even when i enter text for the field nothing shows up ?

Topic Closed

This topic has been closed to new replies.

About this Topic