我試圖隱藏所有的HTML,如果我的自定義字段中的WordPress隱藏的HTML,如果空的,PHP
我使用這個空:
<?php if (the_field('attribute_1') & the_field('value_1') != "") { ?>
<li style="line-height:2.25em;border-top:1px solid #dcdcdc;"><p style="font-size:15px;margin-bottom:0;"><?php the_field('attribute_1'); ?> <span style="float:right;font-weight:600;font-family:'Varela Round';"><?php the_field('value_1'); ?></span></p></li>
<?php } ?>
但只有1個定製字段顯示,任何想法爲什麼?我看着它頗有幾分,但不能弄明白
什麼是the_field( 'attribute_1')'和'the_field的'(價值'value_1')'?你應該使用'&&'。 – mkaatman
當我使用&& only屬性_1顯示 –
時,這些值只是常規文本,當前爲asdasd屬性_1和as_2屬性_0 您的意思是使用&& - 這是正確的。你的不正確。 –