在我的功能中。php我使用的是:
add_action( \'init\', \'create_Videos\' );
function create_Videos() {
register_post_type(\'videos\', array(
\'label\' => __(\'Videos\'),
\'singular_label\' => __(\'Video\'),
\'public\' => true,
\'show_ui\' => true,
\'capability_type\' => \'article\',
\'hierarchical\' => true,
\'rewrite\' => false,
\'query_var\' => true,
\'supports\' => array(\'title\', \'editor\', \'page-attributes\')
));
}
在我的主题中:
$args = array(
\'numberposts\' => -1,
\'orderby\' => \'menu_order\',
\'order\' => \'ASC\',
\'post_type\' => \'videos\'
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
这对meBye有用