سلام
یک کاستوم پست تایپی ایجاد کردم که براش طبق آموزشهای استاد قسمت دسته بندی و برچسب قرار دادم ولی مشکلی که در ادامه نوشتم پیش اومد.
بنده در عکس یک (عدد نوشتم روی عکس) یه دونه دسته بندی ایجاد کردم با نام video و در همون قسمت دسته بندی هم نشون میده که یک پست مربوط به این دسته بندی داریم
اما زمانی که روی اون دسته بندی کلیک میکنم پستهای مربوط به اون دسته بندی نمایش داده نمیشه(عکس 2)
این هم کدها :
add_action('init', 'register_custom_post_type_tax'); add_action( 'init', 'wpdocs_register_custom_taxonomies' ); function register_custom_post_type_tax(){ $labels = array( 'name' => 'اخبار تکنولوژی', 'singular_name' => 'tech', 'menu_name' => 'اخبار تکنولوژی', 'name_admin_bar' =>'tech', 'add_new' => 'افزودن مطالب تکنولوژی جدید', 'add_new_item' => 'اضافه کردن مطلب جدید', 'new_item' => 'مطلب جدید', 'edit_item' =>'ویرایش مطلب', 'view_item' => 'مشاهده', 'all_items' => 'همه مطالب vip', 'search_items' =>'جستجو', 'parent_item_colon' => 'والد مطلب : ', 'not_found' => 'مطلب پیدا نشد.', 'not_found_in_trash' => 'مطلب در زباله دان پیدا نشد', 'featured_image' => 'تصویر شاخص', 'set_featured_image' => _x( 'انتخاب تصویر شاخص', 'Overrides the “Set featured image” phrase for this post type. Added in 4.3', 'textdomain' ), 'remove_featured_image' => _x( 'حذف تصویر شاخص', 'Overrides the “Remove featured image” phrase for this post type. Added in 4.3', 'textdomain' ), 'use_featured_image' => _x( 'Use as cover image', 'Overrides the “Use as featured image” phrase for this post type. Added in 4.3', 'textdomain' ), 'archives' => _x( 'آرشیو مطلب', 'The post type archive label used in nav menus. Default “Post Archives”. Added in 4.4', 'textdomain' ), 'insert_into_item' => _x( 'افزودن به مطلب', 'Overrides the “Insert into post”/”Insert into page” phrase (used when inserting media into a post). Added in 4.4', 'textdomain' ), 'uploaded_to_this_item' => _x( 'آپلود', 'Overrides the “Uploaded to this post”/”Uploaded to this page” phrase (used when viewing media attached to a post). Added in 4.4', 'textdomain' ), 'filter_items_list' => _x( 'فیلتر لیست مطالب', 'Screen reader text for the filter links heading on the post type listing screen. Default “Filter posts list”/”Filter pages list”. Added in 4.4', 'textdomain' ), 'items_list_navigation' => _x( 'پیمایش لیست مطالب', 'Screen reader text for the pagination heading on the post type listing screen. Default “Posts list navigation”/”Pages list navigation”. Added in 4.4', 'textdomain' ), 'items_list' => _x( 'لیست مطالب', 'Screen reader text for the items list heading on the post type listing screen. Default “Posts list”/”Pages list”. Added in 4.4', 'textdomain' ), ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => true, 'menu_position' => null, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ), ); register_post_type( 'tech', $args ); } function wpdocs_register_custom_taxonomies(){ $labels = array( 'name' => 'دسته بندی ها', 'singular_name' => 'دسته بندی', 'search_items' => 'جستجوی دسته بندی ها', 'all_items' => 'همه دسته بندی ها', 'parent_item' => 'والد دسته بندی', 'parent_item_colon' => 'والد دسته بندی', 'edit_item' => 'ویرایش دسته بندی', 'update_item' => 'بروزرسانی دسته بندی', 'add_new_item' => 'افزودن دسته بندی جدید', 'new_item_name' => 'نام دسته بندی جدید', 'menu_name' => 'دسته ها', ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug'=>'tech'), ); register_taxonomy( 'tech','tech', $args ); unset( $args ); unset( $labels ); $labels = array( 'name' => 'برچسب ها', 'singular_name' => 'برچسب', 'all_items' => 'همه برچسب ها', 'parent_item' => 'والد برچسب', 'parent_item_colon' => 'والد برچسب', 'edit_item' => 'ویایش برچسب', 'update_item' => 'بروزرسانی برچسب', 'add_new_item' => 'افزودن برچسب جدید', 'new_item_name' => 'نام برچسب جدید', 'menu_name' => 'برچسب ها', ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' =>array('slug'=>'tag'), ); register_taxonomy( 'tag','tech', $args ); }