Support

Account

Home Forums General Issues style and bg appers when fiels are empty

Unread

style and bg appers when fiels are empty

  • hi

    I’m using this code to show label and value

    <div class="sorse">
    <?php
    $field = get_field_object('sorse');
    $value = $field['value'];
    if (!empty($value)){
        echo '<p>'.$field['label'].' : <br>'.$value.'</p>';
    }
    ?>		
    	</div>

    and this is my CSS

    .sorse {direction:rtl;
    	text-align: right;
    	padding:1%;
    	width:80%;
    	background:#f3ffbc;
    Border-radius:7px;}

    but when I don’t put anything in value field this background still appears

    screenshot :

    http://uupload.ir/files/gkkb_6a4da54d6a4d6.jpg

Viewing 1 post (of 1 total)

The topic ‘style and bg appers when fiels are empty’ is closed to new replies.