Поддержка Темы и шаблоны Убрать "Читать далее" из the_excerpt()

Просмотр 6 ответов — с 1 по 6 (всего 6)
  • Модератор Yuri

    (@yube)

    the_excerpt() не генерирует ссылку.

    То есть как это не генерирует? Я на неё смотрю сейчас.

    if(have_posts()) : the_post();
       echo '<header><h3><a href="' . post_permalink() . '">' . the_title('','',false) . '</a></h3></header>';
       the_excerpt();
       echo '<footer><span class="post-date">' . get_the_date() . '</span><span class="number-of-comments"><a href="' . post_permalink() . '#comments" title="Прочитать комментарии">'. get_comments_number() . '</a></span></footer>';
    endif;

    Ссылки «Читать далее →» есть везде. Тема — Twenty Ten.

    Модератор Yuri

    (@yube)

    Читаем Кодекс http://codex.wordpress.org/Function_Reference/the_excerpt

    Displays the excerpt of the current post with […] at the end, which is not a «read more» link.

    Модератор Yuri

    (@yube)

    Тема — Twenty Ten.

    Имя файла и номера строк, где находится указанный форагмент?

    Модератор Yuri

    (@yube)

    В файле functions.php следующий фрагмент довешивает к стандартному выводу ссылку.

    /**
     * Adds a pretty "Continue Reading" link to custom post excerpts.
     *
     * To override this link in a child theme, remove the filter and add your own
     * function tied to the get_the_excerpt filter hook.
     *
     * @since Twenty Ten 1.0
     * @return string Excerpt with a pretty "Continue Reading" link
     */
    function twentyten_custom_excerpt_more( $output ) {
    	if ( has_excerpt() && ! is_attachment() ) {
    		$output .= twentyten_continue_reading_link();
    	}
    	return $output;
    }
    add_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );

    Displays the excerpt of the current post with […] at the end, which is not a «read more» link.

    Я это читал. Тем не менее ссылки есть.

    Имя файла и номера строк, где находится указанный форагмент?

    Ну, производная от Twenty Ten. Я к тому, что functions.php там тот же самый.

    add_filter( ‘get_the_excerpt’, ‘twentyten_custom_excerpt_more’ );

    От оно чо (с)! Спасибо.

Просмотр 6 ответов — с 1 по 6 (всего 6)
  • Тема «Убрать "Читать далее" из the_excerpt()» закрыта для новых ответов.