好吧,我目前有這個代碼。wp微調功能
<?php
query_posts('category_name=widgets2');
echo "<div id='widgets-wrapper2'><div id='marginwidgets' style='overflow: auto; max- width: 100%; height: 450px; max-height: 100%; margin: 0 auto;'>";
while (have_posts()) : the_post();
echo "<div class='thewidgets2'>";
echo wp_trim_words(the_content(), $num_words = 0, $more = "...");
echo '<div style="height: 20px;"></div><a class="button2" href="'.get_permalink().'">Read More</a></div>';
endwhile;
echo "</div></div>";
?>
,你可以看到,它就會從所有類別名稱widgets2後,然後它應該顯示它。
這行
echo wp_trim_words(the_content(), $num_words = 100, $more = "...");
應修剪掉the_content()的話100,並在年底字符添加一個摘錄,但遺憾的是它不工作,相反,它只是顯示這個解除剪裁在所有的全部內容。
希望這裏的人可以想通。我在任何建議,建議和所有相關的想法打開,謝謝。
謝謝你..很多海洛斯 –