Всем привет!
Есть такой код
<div id="latestbar">
<?php
// this is where the Lead Story module begins
query_posts('showposts=1&offset=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"></a>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Читать весь текст" class="title">
<?php
// this is where the title of the Lead Story gets printed
the_title(); ?>
</a> <div id=write_by> <img src="<?php bloginfo('template_url'); ?>/images/shape_move.gif" alt="This is my site" /> <small><font color=#999999>Создал</font> <?php the_author() ?>. <font color=#999999>Дата создания:</font> <abbr title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s – %2$s'), the_date('', '', '', false), get_the_time()) ?></abbr> </small> </div>
<?php
// this is where the excerpt of the Lead Story gets printed
the_excerpt(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="">Подробнее...</a>
<?php endwhile; ?>
</div><!--END FEATURE-->
он выводит кусок последнего сообщения на главной странице. Хочу поменять количество выводимых слов, но не пойму как…
По идее это должно быть с помощью print, но в данном случае
the_excerpt()
выводит тело текста, но понять почему именно 65-75 слов = не могу. Может в CSS задается, но там ведь только ширина слоя…
Вот кусок CSS
#latestbar{
background:#ffffff;
padding:7px 7px 7px 7px;
margin:7px 0 0 7px;
width:345px;
height: 200px;
text-align:justify;
float:right;
font-size:8pt;
border-width: 1px 1px 1px 1px;
border-style: solid;
border-color: #dddddd;
}
> Я еще только учусь!
Эт точно =) Смотри функциональные настройки, и, кодекс! Не стоит забывать об этом ресурсе, там есть почти всё
the_excerpt() замените на the_content(‘читать дальше»’) и пользуйтесь тегом <!–more–> для обрезания поста в нужном месте (в виз. редакторе есть кнопка)
Огромное спасибо! Очень помогло!
в результате воспользовался the-excerpt-reloaded.php = так проще и настроек больше!
Еще раз спасибо sonika – теперь за инфу на Вашем блоге!