Answer the question
In order to leave comments, you need to log in
Wordpress - how to display a short description?
Tell me how to display a short description, let's say 20 words.
<?php
$html = array(
'before_widget' => '<div class="entry-content">', // - родительский див, начало.
'after_widget' => '</div>', // - родительский див, конец.
'before_title' => '<h1>', // - тег HTML перед заголовком.
'after_title' =>'</h1><br />' // - тег HTML после заголовка.
);
$options = array(
'title' => 'Свежие новости', // - заголовок блока.
'number' => 5, // - количество выбранных элементов.
'show_date' => 1 // - показывать дату публикации.
);
# Выводим виджет:
the_widget('WP_Widget_Recent_Posts', $options, $html);
?>
Answer the question
In order to leave comments, you need to log in
Went the other way.
<?php $the_query = new WP_Query( 'showposts=4' ); ?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); the_date() ?></a></li>
<li><?php the_excerpt(__('(more…)')); ?></li>
<?php endwhile;?>
</ul>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question