嗨,伙计们,你能告诉我如何在我的代码中获取post\\u内容的摘录长度为15吗:
<?php
$args = array( \'numberposts\' => \'2\', \'tax_query\' => array(
array(
\'taxonomy\' => \'post_format\',
\'field\' => \'slug\',
\'terms\' => \'post-format-aside\',
\'operator\' => \'NOT IN\'
),
array(
\'taxonomy\' => \'post_format\',
\'field\' => \'slug\',
\'terms\' => \'post-format-image\',
\'operator\' => \'NOT IN\'
)
) );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
echo
\'<div class="news_home">
<div class="content_left"><img src="\'.get_permalink($recent[\'ID\'])."\'>".get_the_post_thumbnail($recent[\'ID\']).\'</div>
<div class="content_right">
<h4> \'. ( __($recent["post_title"])).\'</h4>
<span>\'. mysql2date(\'j.m.Y\', $recent["post_date"]) .\'</span>
<div class="HR_ornament">
<hr class="news_hr"/>
<div class="ornament_news"></div>
</div>
<p class="news_text">\'.( __($recent["post_content"])).\'
<a href="\' . get_permalink($recent["ID"]) . \'">[...]</a>
</p></div>
</div>
\';
提前感谢您!