最新公告
  • 欢迎您光临站盟网(原知事网),一个优质的网站源码基地、精品网站模板和插件。欢迎加入永久SVIP
  • WordPress函数the_content()用法 调用当前文章正文内容

    正文概述 知事网   2020-09-11 09:09   491

    描述:

    显示当前文章的正文内容

    用法:

    <?php the_content( $more_link_text, $stripteaser ); ?>

    参数:

    $more_link_text
    
    (string) (可选) 为“more”链接显示的链接文本。
    
    默认值: '(more...)'
    
    $stripteaser
    
    (boolean) (可选) 在更多的文本之前删除摘要内容。
    
    默认值: false

    示例:

    <?php the_content('Read more...'); ?>

    源文件:

    /**
    * Display the post content.
    *
    * @since 0.71
    *
    * @param string $more_link_text Optional. Content for when there is more text.
    * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false.
    */
    function the_content( $more_link_text = null, $strip_teaser = false) {
    $content = get_the_content( $more_link_text, $strip_teaser );
    
    /**
    * Filter the post content.
    *
    * @since 0.71
    *
    * @param string $content Content of the current post.
    */
    $content = apply_filters( 'the_content', $content );
    $content = str_replace( ']]>', ']]>', $content );
    echo $content;
    }

    站盟网 » WordPress函数the_content()用法 调用当前文章正文内容

    发表评论

    还没有评论,快来抢沙发吧!

    如需帝国cms功能定制以及二次开发请联系我们

    联系作者
    请选择支付方式
    ×
    支付宝支付
    微信支付
    余额支付
    ×
    微信扫码支付 0 元