Get the excerpt of post_content
Hi guys can you explain me how to get a excerpt length of 15 for the post_content in my code:
?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
';
Thank you in advance!
Topic post-content custom-content excerpt Wordpress
Category Web