Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
the_excerpt_rss() - 显示feed的文章摘录 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / the_excerpt_rss()

the_excerpt_rss()

显示feed的文章摘录


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 3 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "7daa69091da2c3c5a00b72a3f5f57880" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "1d2daed0c24ae2a01c59b4de2da6b9fe" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "da3fa25e51008d111052e4f7cd1619a4" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

excerpt 摘要more...

rss

themore...



源码

查看源码 官方文档


更新日志

版本描述
0.71开始引入

使用示例

  • 示例1

    实例

    要创建在URL(例如http://www.example.com/?feed=myfeed&type=excerpt)上接受GET参数的自定义feed,请在特定feed文件中放置以下内容,以发送摘录(the_excerpt_rss()),而不是完整内容(the_content()):

    if isset( $_GET['type'] ) ) {
    	$typewanted = sanitize_text_field( $_GET['type'] );
    }
    
    if ( $typewantd == 'excerpt' ) {
    	// Wrap the Excerpt in a span tag for CSS styling
    	echo '<span class="excerpt">'; 
    		the_excerpt_rss();   
    	echo '</span>';
    } else {  
    	// Otherwise they want the full content so wrap it in another span
    	echo '<span class="content">';
    		the_content();
    	echo '</span>';
    }