WordPress.org

Ready to get started?Download WordPress

Forums

Theme Options: If field is empty (2 posts)

  1. SolidSnake2003
    Member
    Posted 1 year ago #

    Ive added a theme options to my custome wordpress theme. I added a series of links in my footer. I would like to add a command into either my options page, or my template for in case the field is empty to show a default link. Here is an example of my code:

    <?php if( get_option($shortname."_eliteaffiecu1") && get_option($shortname."_eliteaffiect1") && get_option($shortname."_eliteaffieci1") ): ?>
    <a>" target="_blank" title="<?php echo get_option($shortname."_eliteaffiect1"); ?>"><img src="<?php echo get_option($shortname."_eliteaffieci1"); ?>" title="" alt="" width="50px" height="60px" border="0" class="img" hspace="0" vspace="0" /></a><?php endif; ?>
  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    have you tried:

    <?php if( ??? ) : ?>
    <a ... your options link code ... /a>
    <?php else : ?>
    <a ... default link ... /a>
    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic