【发布时间】:2014-08-28 11:59:44
【问题描述】:
再次需要一点帮助,这是一个返回文本内容并在wordpress中阅读更多链接的函数:
function whisper_entry_contentoffer1()
{
global $whisper;
// Check on singular pages
$is_single = is_singular() && !is_page_template( 'tpl/blog.php' ) && !is_page_template( 'tpl/blog-boxes.php' );
// Allow to config via global variable
if ( isset( $whisper['is_single'] ) )
$is_single = $whisper['is_single'];
if ( $is_single )
{
echo '<div class="entry-content">';
the_content();
wp_link_pages( array(
'before' => '<p class="pages">' . __( 'Pages:', 'whisper' ),
'after' => '</p>',
'link_before' => '<span>',
'link_after' => '</span>',
) );
echo '</div>';
return;
}
// Archives & Blog pages
// Display type
$display = fitwp_option( 'blog_display' );
// Allow to config via global variable
if ( isset( $whisper['blog_display'] ) )
$display = $whisper['blog_display'];
if ( !$display )
$display = 'content';
echo '<div class="entry-summary">';
// Excerpt
if ( 'excerpt' == $display )
{
the_excerpt();
return;
}
$more_text = whisper_more_text2();
// Post content before more tag
if ( 'more' == $display )
{
if ( is_page_template( 'tpl/blog.php' ) || is_page_template( 'tpl/blog-boxes.php' ) )
{
global $more;
$more = false;
}
the_content( $more_text );
wp_link_pages( array(
'before' => '<p class="pages">' . __( 'Pages:', 'whisper' ),
'after' => '</p>',
'link_before' => '<span>',
'link_after' => '</span>',
) );
}
else
{
whisper_content_limitoffer1( whisper_content_length(), $more_text );
}
echo '</div>'; // .entry-summary
}
现在我需要将输出文本限制为 12 个字。有什么建议或意见吗?!
谢谢...
【问题讨论】: