Forums

[resolved] if custom value does not exist, display timedate (2 posts)

  1. savesheep
    Member
    Posted 3 years ago #

    Hello everyone!

    I have a custom value for some posts called tinytext. I want it to display the date of the post IF tinytext does not have a value. Make sense?

    Right now I use this code to display the custom value:
    <?php if ( function_exists('get_custom_field_value') ){ get_custom_field_value('tinytext', true); } ?>

    I need to somehow add an else statement that will write the following if there is no value for tinytext:
    <?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> -->

    Thanks!

  2. savesheep
    Member
    Posted 3 years ago #

    got it:
    <?php if ( function_exists('get_custom_field_value') ) { get_custom_field_value('tinytext', true); } else { the_time('F jS, Y'); } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic