这是我的自定义帖子类型代码
/* Job Opening */
add_action( \'init\', \'create_job_opening\' );
function create_job_opening() {
register_post_type( \'job_opening\',
array(
\'labels\' => array(
\'name\' => \'Job Opening\',
\'singular_name\' => \'Job Opening\',
\'add_new\' => \'Add New\',
\'add_new_item\' => \'Add New Job Opening\',
\'edit\' => \'Edit\',
\'edit_item\' => \'Edit Job Opening\',
\'new_item\' => \'New job opening\',
\'view\' => \'View\',
\'view_item\' => \'View job opening\',
\'search_items\' => \'Search job opening\',
\'not_found\' => \'No Job Opening found\',
\'not_found_in_trash\' => \'No Job Opening found in Trash\',
\'parent\' => \'Parent job opening\'
),
\'public\' => true,
\'menu_position\' => 15,
\'supports\' => array( \'title\', \'editor\', \'thumbnail\' ),
\'taxonomies\' => array( \'\' ),
\'menu_icon\' => get_bloginfo(\'template_directory\') . \'/images/Careerpost-icon.png\', // Icon Path
\'has_archive\' => true
)
);
}
add_action( \'admin_init\', \'my_admin_job\' );
function my_admin_job() {
add_meta_box( \'job_opening_meta_box\',
\'job Details\',
\'display_job_opening_meta_box\',
\'job_opening\', \'normal\', \'high\'
);
}
我可以把我的帖子调到侧边栏
$args = array( \'post_type\' => \'job_opening\', \'posts_per_page\' => 30 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
endwhile;
我的
single.php
现在为空。如何创建
job-single-post.php
如何指定
job-single-post.php
是job\\u opening CPT的单岗位模板吗?。