I am using 4 custom post types of this type of announcement: The problem I have is that these pages do not get post comment links, which say the comments are closed. How can I get the comments to work? For example: add_post_type_support ('books', 'comments'); Or: For example: 'class', 'post-text' itemprop = "text" P> My example code has been copied from functions.php to my theme: register_post_type ('texts', Array ('label' = & gt; array ('name' = & gt; 'texts', 'singular_name' = & gt; 'text'), 'public' => is true, 'has_archive' = & gt; ; True, 'menu_position' => 5));
// sd_register_post_type, which is now http://somadesign.ca/projects/smarter-custom-post-type/, is no longer required with WP3.1 add_action ('init' , 'Create_post_type', 0); Before / / sd_register_post_type the function function create_post_types () {$ post_supports = Array ('title', 'editor', 'author', 'thumbnail', 'fraction', 'trackback', 'custom field', 'comments' ' an amendment '); $ Post_type_slug = 'my-news'; // maximum 20 characters! $ Post_type_slug_plural = $ post_type_slug; Sd_register_post_type ($ post_type_slug, array ('labels' = & gt; array ('name' = & gt; 'my news', 'singler_name' => = 'my new' //)), 'rewrite' = & gt; ; Array ('Slog' = & gt; $ post_type_slug, 'with_front' = & gt; false // pre-existing / blog / ...), 'public' => true, 'hierarchical' = & gt; Wrong, 'supports' = & gt; $ post_supports, 'menu_position' = & gt; 6, 'capability_type' = & gt; 'post'), $ post_type_slug_plural); } Add_action ('init', 'register_taxonomies_for_custom_post_types', 11); // 11 = sd_register_post_type after the function function register_taxonomies_for_custom_post_types () {$ post_type_slug = 'my-news'; // maximum 20 characters! Register_taxonomy_for_object_type ('category', $ post_type_slug); Register_taxonomy_for_object_type ('post_tag', $ post_type_slug); } Add_action ('init', 'build_taxonomies', 0); Function build_taxonomies () {$ post_types = array ('post', / * 'page', * / 'my-news'); Register ('city', $ post_type, array ('public' = & gt; true, 'labels' = & gt; array ('name' = & gt; 'city', 'singular_name' = & gt; ), 'Hierarchical' = & gt; true, 'rewrite' = & gt; array ('slug' = & gt; 'my-news / cities', 'with_french' => false // pre-paid / blog / ... do not ...))); }
Comments
Post a Comment