add_action('after_setup_theme','your_theme_setup');function your_theme_setup() { if ( function_exists( 'register_cursorial' ) ) { register_cursorial(array( // Array with the custom loops 'main-feed' => array( // The key is the name of the loop 'label' =>
函数your_theme_setup(){if(function_exists('register_cursorial')){register_cursorial(array(//带有自定义循环的数组'main-feed'=> array(//键是循环'label'的名称=>
__( 'Main Feed' ), // The official label of the loop 'max' => 2, // The maximum amount of allowed posts 'post_type' => array( 'page' ), // Limit posts with post type
__('Main Feed'),//循环的正式标签'max'=> 2,// //允许的帖子数量上限'post_type'=> array('page'),//限制帖子类型的帖子
. Can be defined as an array or a string 'childs' => array( // If set, all posts in this loop can have childs 'max' => 2, // The maximum amount of allowed childs posts 'post_type' =
可以定义为数组或字符串'childs'=> array(//如果设置,则此循环中的所有帖子都可以具有childs'max'=> 2,//允许的最大childs帖子数量'post_type'=
> 'post', // Limit child posts with post type 'fields' => array( // Set the displayable child post field 'post_title' => array( // The key is the name of the post field 'optional' =
>'post',//限制帖子类型为'fields'的子帖子=> array(//设置可显示的子帖子字段'post_title'=> array(//键是帖子字段的名称'optional'=
> false, // If s
> false,//如果s
et to true, the field can be hidden by the editor in the admin 'overridable' => true // If set to true, the field's content can be overridden by the editor in the admin ), 'post_date' => array( '
设为true时,该字段可以由编辑器在admin'overridable'=> true中隐藏// //如果设置为true,则该字段的内容可以由admin的编辑器覆盖)'post_date'=> array('
optional' => true, 'overridable' => false ) ) ), 'fields' => array( // Set the displayable post field 'post_title' => array( 'optional' => false, 'overridable' => true
optional'=> true,'overridable'=> false)))),'fields'=> array(//设置可显示的帖子字段'post_title'=> array('optional'=> false,'overridable'=> true
), 'post_excerpt' => array( 'optional' => false, 'overridable' => true ), 'image' => array( // This field will fetch the first occuring image from the post
),'post_excerpt'=> array('optional'=> false,'overridable'=> true),'image'=> array(//此字段将从帖子中获取第一个出现的图像
'optional' => true, 'overridable' => true ) ) ), 'second-feed' => array( 'label' => __( 'Secondary Feed' ), 'max' => 4, 'fields' =
'optional'=> true,'overridable'=> true)))),'second-feed'=> array('label'=> __('Secondary Feed'),'max'=> 4,'fields'=
> array( 'post_title' => array( 'optional' => false, 'overridable' => false ), 'post_excerpt' => array( 'optional' => true, 'overridable' => true ), 'post_date'
> array('post_title'=> array('optional'=> false,'overridable'=> false),'post_excerpt'=> array('optional'=> true,'overridable'=> true),'post_date'
=> array( 'optional' => false, 'overridable' => false ) ) )),array( // Second argument is an array with some admin config __( 'Home'
=> array('可选'=> false,'overridable'=> false))))),array(//第二个参数是带有一些管理员配置的数组__('Home'
) => array( // The key is the name of the page where editors can edit specified loops 'main-feed' => array( // The key is the name of the loop that will be editable 'x' => 0
)=> array(//键是编辑者可以在其中编辑指定循环的页面的名称'main-feed'=> array(//键是将可编辑的循环的名称'x'=> 0
, // In what column this loop should be placed 'y' => 0, // In that row this loop should be placed 'width' => 2, // How many columns this loop is wide 'height' => 7
,// //该循环应放在哪一列'y'=> 0,//该循环应在那一行中放置'width'=> 2,2,//此循环宽多少列'height'=> 7
// How many rows this loop is tall ), 'banner-space-1' => array( // If there's no matched loop with this name, the space will be occupied by a dummy placeholder 'x' => 2, '
//这个循环有多高行),'banner-space-1'=> array(//如果没有与此名称匹配的循环,该空间将被一个虚拟占位符'x'=> 2,'
y' => 0, 'width' => 1, 'height' => 2, 'dummy-title' => __( 'Banners' ), // A customized title 'dummy-description' => __( 'On
y'=> 0,'width'=> 1,'height'=> 2,'dummy-title'=> __('Banners'),//自定义标题'dummy-description'=> __('On
front page there are a couple of banners here.' ) // A customize
首页上有几个横幅。')//自定义
d description ), 'second-feed' => array( 'x' => 2, 'y' => 2, 'width' => 1, 'height' => 3 ) ), __( 'Sub pages' )
d description),'second-feed'=> array('x'=> 2,'y'=> 2,'width'=> 1,'height'=> 3)),__('子页面')
=> array( // Another admin page with a set of loops '_dummy' => array( 'x' => 0, 'y' => 0, 'width' => 2, 'height' => 7, '
=> array(//具有一组循环的另一个管理页面'_dummy'=> array('x'=> 0,'y'=> 0,'width'=> 2,'height'=> 7,'
dummy-title' => __( 'Page or post content' ), 'dummy-description' => __( 'The current page or post content.' ) ), 'second-feed' => array( 'x' =
dummy-title'=> __('页面或帖子内容'),'dummy-description'=> __('当前页面或帖子内容。')),'second-feed'=> array('x'=
> 2, 'y' => 0, 'width' => 1, 'height' => 7 ) )) );
> 2,'y'=> 0,'width'=> 1,'height'=> 7))));
} }