Ray,peter在为您包装一些东西方面做得很好,但是我也想插话,让您从几个不需要插件支持的领域开始。不管多好,有些东西不太需要它。(视技能而定,当然风险自负)。
这是用于创建自定义帖子类型的代码Products
这将允许您进一步自定义WordPress站点的输出。当然,我建议您阅读Codex Link about Post Types, 还有这个关于Querying your loops for URL REWriting
add the following code to your themes functions.php file or in a plugin:
function wpse3242_product_posttype() {
register_post_type( \'products\',
array(
\'labels\' => array(
\'name\' => __( \'Products\' ),
\'singular_name\' => __( \'Product\' ),
\'add_new\' => __( \'New Product\' ),
\'add_new_item\' => __( \'Add Product\' ),
\'edit_item\' => __( \'Edit Product\' ),
\'new_item\' => __( \'New Product\' ),
\'view_item\' => __( \'View Products\' ),
\'search_items\' => __( \'Search Products\' ),
\'not_found\' => __( \'No Products found\' ),
\'not_found_in_trash\' => __( \'No Products found in trash\' )
),
\'public\' => true,
\'publicly_queryable\' => true,
\'exclude_from_search\' => false, // lets not guess what this will be, lets be authorative
\'show_ui\' => true,
\'show_in_menu\' => true,
\'query_var\' => \'products\',
\'capability_type\' => \'post\',
\'has_archive\' => true,
\'hierarchical\' => true,
\'supports\' => array(\'title\',\'editor\',\'thumbnail\',\'comments\'),
\'rewrite\' => array(
\'with_front\' => true,
\'pages\' => true,
\'feeds\' => false,
\'slug\' => \'products\',
),
) );
}
add_action( \'init\', \'wpse3242_product_posttype\' );
下面是为您的
Item Tags & Categories
, 这些可以稍后用于排序,但您认为合适,我已经对代码进行了概括,希望您能够理解如何根据需要使用它。我会读到
Taxonomies from the Codex 了解它们如何与WordPress机器交互。
add the following code to your themes functions.php file or in a plugin:
function wpse3242_part_type_tax() {
$labels = array(
\'name\' => \'Item Manager\',
\'singular_name\' => \'Item\',
\'search_items\' => \'Search Items\',
\'popular_items\' => \'Popular Items\',
\'all_items\' => \'All Items\',
\'parent_item\' => \'Last Item\',
\'edit_item\' => \'Edit Item\',
\'update_item\' => \'Change Item\',
\'add_new_item\' => \'Add Item\',
\'new_item_name\' => \'Create Item\',
\'separate_items_with_commas\' => \'Separate Items with commas\',
\'add_or_remove_items\' => \'Add or remove Items\',
\'choose_from_most_used\' => \'Choose from most used Items\'
);
$args = array(
\'label\' => \'items\',
\'labels\' => $labels,
\'public\' => true,
\'hierarchical\' => true,
\'show_ui\' => true,
\'show_in_nav_menus\' => true,
\'args\' => array( \'orderby\' => \'title\' ),
\'rewrite\' => array( /*\'slug\' => \'item\', if you get into some advanced url-rewriting you may use this in some fashion */ \'with_front\' => true, \'hierarchical\' => true ),
\'query_var\' => true
);
register_taxonomy( \'items\', array( \'products\' ), $args );
}
add_action(\'init\', \'wpse3242_part_type_tax\');
这远不是一个完整的答案,但希望这足以让你找到正确的方向。
干杯