Wednesday 15 January 2014

php - Custom post-type post wont show when using a custom template -



php - Custom post-type post wont show when using a custom template -

this in settings under register post type:

register_post_type( 'support', /* (http://codex.wordpress.org/function_reference/register_post_type) */ // let's add together options post type array( 'labels' => array( 'name' => __( 'support', 'bonestheme' ), /* title of grouping */ 'singular_name' => __( 'support', 'bonestheme' ), /* individual type */ 'all_items' => __( 'all support', 'bonestheme' ), /* items menu item */ 'add_new' => __( 'add new', 'bonestheme' ), /* add together new menu item */ 'add_new_item' => __( 'add new support', 'bonestheme' ), /* add together new display title */ 'edit' => __( 'edit', 'bonestheme' ), /* edit dialog */ 'edit_item' => __( 'edit support', 'bonestheme' ), /* edit display title */ 'new_item' => __( 'new support', 'bonestheme' ), /* new display title */ 'view_item' => __( 'view support', 'bonestheme' ), /* view display title */ 'search_items' => __( 'search support', 'bonestheme' ), /* search custom type title */ 'not_found' => __( 'nothing found in database.', 'bonestheme' ), /* displays if there no entries yet */ 'not_found_in_trash' => __( 'nothing found in trash', 'bonestheme' ), /* displays if there nil in trash */ 'parent_item_colon' => '' ), /* end of arrays */ 'description' => __( 'this illustration slide', 'bonestheme' ), /* custom type description */ 'public' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'show_ui' => true, 'query_var' => true, 'menu_position' => 8, /* order want appear in on left hand side menu */ 'menu_icon' => get_stylesheet_directory_uri() . '/library/images/custom-post-icon.png', /* icon custom post type menu */ 'rewrite' => array( 'slug' => 'support', 'with_front' => false ), /* can specify url slug */ 'has_archive' => 'custom_type', /* can rename slug here */ 'capability_type' => 'post', 'hierarchical' => false, 'taxonomies' => array('category'), /* next 1 important, tells what's enabled in post editor */ 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'sticky') ) /* end of options */ ); /* end of register post type */

when pages created under custom post type routed , permalinked correctly. when load page, default error shows up.

i have created single-support.php page , blank can see blank page load create sure working.

any thought why doesn't seem working?

from wordpress post type documentation:

http://codex.wordpress.org/post_types

"note: in cases, permalink construction must updated in order new template files accessed when viewing posts of custom post type. this, go administration panels > settings > permalinks, alter permalink construction different structure, save changes, , alter desired structure. "

this fixed issue.

php wordpress

No comments:

Post a Comment