2
我試圖剝離默認情況下爲the_excerpt()放置的標籤;WordPress刪除摘錄篩選器
我試過下面...
<?php remove_filter('the_excerpt', 'wpautop'); ?>
<p class='test'><?php the_excerpt(); ?></p>
,我已經試過......
<?php $formatted = remove_all_filters('the_excerpt', the_excerpt()); ?>
<p class='test'><?php echo $formatted ?></p>
我期待產生這樣......
<p class='test'>the excerpt text <a href='http://continuereadinglink'>etc.</a></p>
但是相反的WordPress輸出這...
<p class='test'></p>
<p class='default-align'>the excerpt text <a href='http://continuereadinglink'>etc.</a></p>
其實我已經找到了解決辦法在這裏http://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/,但它主要涉及更換摘錄功能,我寧願避免這種情況,因爲我只是想剝離過濾掉。
啊是啊,當然,我應該已經意識到這點。雖然通過刪除過濾器,但仍希望剝離「default-align」類。 – SparrwHawk 2012-02-23 11:21:24
嘗試<?php remove_filter('the_excerpt','default-align'); ?> – seferov 2012-02-23 11:26:51
沒有:-( 我試圖 ''' ' –
SparrwHawk
2012-02-23 11:40:05