【发布时间】:2021-07-24 05:33:05
【问题描述】:
我正在尝试下面的 sn-p。我正在尝试删除 URL 字段的“http”和“https”,以使输出看起来更好,但我无法真正让它工作。我不知道这里出了什么问题。
<?php if ( $site = get_field( 'vendor_website' ) ) : ?>
<?php
$site = str_replace(array('http://', 'https://'), '', $site);
$site = rtrim($site, '/');
echo '<a class="vendor-link" href="' $site '">' $site 'target="_blank">' '</a>';
?>
<?php endif; ?>
【问题讨论】:
标签: wordpress advanced-custom-fields