custom post type work when user login!
-
hi
my custom post type, create for news blog
CPT when user login: correct permalink & show post content & select specific theme
for example URL: http://domain.tld/news/20module/but when dont login: permalink dont work, don’t show post content, dont select specific theme
for example URL: for example URL: http://domain.tld/20module/my code:
$labels = array( 'name' => 'خبرها', 'singular_name' => 'خبر', 'add_new' => 'افزودن خبر', 'add_new_item' => 'افزودن خبر جدید', 'edit_item' => 'ویرایش خبر', 'new_item' => 'خبر جدید', 'view_item' => 'نمایش خبر', 'search_items' => 'جستجوی خبر', 'not_found' => 'مطلب خبری یافت نشد', 'not_found_in_trash' => 'خبری در زبالهدان یافت نشد', 'parent_item_colon' => 'خبرها', 'menu_name' => 'اخبار فروشگاه', ); $args = array( 'labels' => $labels, 'hierarchical' => false, 'description' => 'اخبار سایت', 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ), //'page-attributes' 'taxonomies' => array( 'page-category' ), 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 7, 'menu_icon' => plugins_url('shoppress/images/module/news.png'), 'show_in_nav_menus' => true, 'publicly_queryable' => true, 'exclude_from_search' => true, 'has_archive' => true, 'query_var' => true, 'can_export' => true, 'rewrite' => array('slug' => 'news'), '_builtin' => false, 'capability_type' => 'post' ); register_post_type( 'news', $args ); //register_taxonomy("newscat", array("news"), array("hierarchical" => true, "label" => "دستهها", "singular_label" => "دستهها", "rewrite" => array( 'slug' => 'news', 'with_front' => false ))); $labels = array( 'name' => 'دستهها', 'singular_name' => 'دستهها', 'search_items' => 'جستجوی دسته', 'popular_items' => 'بیشتر استفاده شده', 'all_items' => 'تمام خبرها', 'parent_item' => 'مادر دسته', 'edit_item' => 'ویرایش دسته', 'update_item' => 'بروزرسانی دسته', 'add_new_item' => 'افزودن دسته جدید', 'new_item_name' => 'دسته جدید', 'separate_items_with_commas' => 'جداسازی دستهها با کاما', 'add_or_remove_items' => 'افزودن یا حذف دسته', 'choose_from_most_used' => 'انتخاب از محبوبها' ); $args = array( 'label' => 'دسته', 'labels' => $labels, 'public' => true, 'hierarchical' => true, 'show_ui' => true, 'show_in_nav_menus' => true, 'args' => array( 'orderby' => 'term_order' ), 'rewrite' => array( 'slug' => 'newscat', 'with_front' => true ), 'query_var' => true ); register_taxonomy( 'newscat', 'news', $args );
The topic ‘custom post type work when user login!’ is closed to new replies.