Forums

custom fields error if blank (1 post)

  1. markoburns
    Member
    Posted 6 months ago #

    Hi - I've a custom field column2 in pages.php. It works ok, but if the field is blank for certain pages where not required it gives and error in page.php - syntax wrong in this ?

    <?php $custom_fields = get_post_custom();
    $my_custom_field = $custom_fields['column2'];
    foreach ( $my_custom_field as $key => $value )
    echo "".$value.""; ?>

Reply

You must log in to post.

About this Topic