1
我使用WooCommerce,不得不包括從DIV內容
<br>
在產品名稱
只刪除
。
這打破了現在顯示爲
<br />
在.woocommerce,麪包屑
。
這是麪包屑的樣子:
<nav class="woocommerce-breadcrumb" itemprop="breadcrumb">
<a href="http://localhost/WP">Home</a>
/
<a href="http://localhost/WP/product-category/guitars/">Guitars</a>
/
<a href="http://localhost/WP/product-category/guitars/electric-guitars/">Electric Guitars</a>
/
<a href="http://localhost/WP/product-category/guitars/electric-guitars/fender-electric-guitar/">Fender-123-electric-guitar</a>
/ Fender American Standard<br /> Stratocaster Sienna Sunburst
</nav>
正如你所看到的最後一行導航包含在瀏覽器字面上看起來像< BR />
目前在休息前我試圖擺脫它,但它打破了麪包屑的功能!
$(function() {
$('.woocommerce-breadcrumb').text(function(_,txt) {
return txt.split('<br />').shift();
});
});
有什麼建議嗎?
謝謝!
PERFECTO! 非常感謝!這就是我正在尋找的東西(: –
@MikeyMusch不客氣,我很高興能夠幫到你。 – undefined
@MikeyMusch請記住
是自動關閉的,並且沒有HTML結束斜線。 – Rob