Support

Account

Home Forums General Issues Default value not working until after update post

Unread

Default value not working until after update post

  • Hi

    I have a true/false checkbox which is checked by default. However, it doesn’t work as expected unless the post is ‘updated’. Here’s my code in the the tempalte file:

    <?php 
    $smartBanner = get_post_meta($post->ID, 'smart_banner', true);
    if ($smartBanner) { ?>
    BANNER
    <?php } else { ?>
    NO BANNER
    <?php } ?>

    How do i fix this?

    Thanks

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.