代码基本原理,新建一个自定义分类法“shot”,自动从另一个站点的RSS抓取文章,放在一个数组中使用这个数组创建“shot”文章,并为文章添加自定义栏目image和link_url,方便调用缩略图和原文链接。将下面代码添加到当前主题functions.php中即可。<?/* Post Type------------------------------------------------------------------------------------ */add_action( 'init', 'register_cpt_shot' );functionregister_cpt_shot() {$labels=array('name' => _x( 'Dribble Shots', 'shot' ),'singular_name' => _x( 'Dribbble Shot', 'shot' ),'add_new' => _x( 'Add New', 'shot' ),'add_new_item' => _x( 'Add New Dribbble Shot', 'shot' ),'edit_item' => _x( 'Edit Dribbble Shot', 'shot' ),'new_item' => _x( 'New Dribb
...
继续阅读
(17)