我正在嘗試在回傳周圍放置一個 div。不知道怎么...
add_filter( 'the_content', function( $content ) {
if (is_singular('cda')) {
return get_the_term_list( get_the_ID(), 'cda_cat', 'Product:' ).$content;
}
}, -10);
uj5u.com熱心網友回復:
試試這個:
add_filter( 'the_content', function( $content ) {
if (is_singular('cda')) {
?><div class="yourclass"><?php
return get_the_term_list( get_the_ID(), 'cda_cat', 'Product:' ).$content;
?></div><?php
}
}, -10);
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/381603.html
標籤:php html WordPress的 功能
