只显示带有php的跨度if

问题描述 投票:-1回答:1

我想在属性大小旁边添加一个(参见span)链接(如下所示:https://www.keurigkindje.nl/product/test-trui/

如您所见,链接现在也放在属性颜色旁边。在代码中我想让它只显示在属性大小旁边。

像php这样的东西(...

<label for="<?php echo esc_attr( sanitize_title( $attribute_name ) ); ?><?php echo wc_attribute_label( $attribute_name ); ?>

<span style="font-size:12px; font-weight:300; margin-left:12px; text-decoration:underline;" class="maattabel5" style="cursor: pointer;">welke maat past?</span>

先感谢您!

php if-statement attributes label
1个回答
0
投票

你可以在span之前添加条件

<?php if($attribute_name == "Kies uw Maat"){ ?>
    <span style="font-size:12px; font-weight:300; margin-left:12px; text-decoration:underline;" class="maattabel5" style="cursor: pointer;">welke maat past?</span>
<?php } ?>
© www.soinside.com 2019 - 2024. All rights reserved.