正如NW-Tech评论的那样,您应该为其使用自定义的帖子类型。检查codexregister_post_type.
您可以尝试以下方式:
function partners_custom_init() {
$labels = array(
\'name\' => \'Partners\',
\'singular_name\' => \'Partner\',
\'add_new\' => \'Add New\',
\'add_new_item\' => \'Add New Partner\',
\'edit_item\' => \'Edit Partner\',
\'new_item\' => \'New Partner\',
\'all_items\' => \'All Partners\',
\'view_item\' => \'View Partner\',
\'search_items\' => \'Search Partners\',
\'not_found\' => \'No Partners found\',
\'not_found_in_trash\' => \'No Partners found in Trash\',
\'parent_item_colon\' => \'\',
\'menu_name\' => \'Partners\'
);
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'show_in_menu\' => true,
\'query_var\' => true,
\'rewrite\' => array( \'slug\' => \'partner\' ),
\'capability_type\' => \'post\',
\'has_archive\' => true,
\'hierarchical\' => false,
\'menu_position\' => null,
\'supports\' => array( \'title\', \'editor\', \'author\', \'thumbnail\', \'excerpt\', \'comments\' )
);
register_post_type( \'partner\', $args );
}
add_action( \'init\', \'partners_custom_init\' );
在函数中使用这段代码。php您可以在添加帖子或页面时添加合作伙伴。
你没有解释你想在哪里显示结果。您可以使用custom post type templates 或acustom query 在文件中的任何位置显示它们。