<div class="oldprice">Старая цена: <?php get_special_field('oldprice','',false); ?> руб.</div> The old price is substituted from the admin panel. If it is not there, it is necessary that the div block does not appear. Please help me how to do it.
Старая цена: руб.The old price is substitut...">
<div class="oldprice">Старая цена: <?php get_special_field('oldprice','',false); ?> руб.</div> The old price is substituted from the admin panel. If it is not there, it is necessary that the div block does not appear. Please help me how to do it.
Check directly on the server whether the value of the variable is filled with the old price and if it is not there, do not output a block
<?php $price = get_special_field('oldprice','',false); if(!empty($price)) { ?> <div class="oldprice">Старая цена: <?= get_special_field('oldprice','',false) ?> руб.</div> <?php } ?> Source: https://ru.stackoverflow.com/questions/504723/
All Articles