Постоянная ссылка для отдельных не работает

Я много читал о своей простой проблеме, но не смог найти простой ответ, поэтому, пожалуйста, извините мою нообиенность. У меня есть пользовательский тип сообщения, зарегистрированный в functions.php, например:

<?php function my_custom_post_procedimentos() { $labels = array( 'name' => _x( 'Procedimentos', 'post type general name' ), 'singular_name' => _x( 'Procedimento', 'post type singular name' ), 'add_new' => _x( 'Add New', 'Procedimento' ), 'add_new_item' => __( 'Add New Procedimento' ), 'edit_item' => __( 'Edit Procedimentos' ), 'new_item' => __( 'New Procedimento' ), 'all_items' => __( 'All Procedimentos' ), 'view_item' => __( 'View Procedimentos' ), 'search_items' => __( 'Search Procedimentos' ), 'not_found' => __( 'No Procedimento found' ), 'not_found_in_trash' => __( 'No Procedimento found in the Trash' ), 'parent_item_colon' => '', 'menu_name' => 'Procedimentos' ); $args = array( 'labels' => $labels, 'description' => 'Holds our Procedimentos specific data', 'public' => true, 'menu_position' => 5, 'supports' => array( 'title', 'editor', 'thumbnail' ), 'has_archive' => true, 'publicly_queryable' => true, 'show_ui' => true, 'can_export' => true ); register_post_type( 'procedimentos', $args ); } add_action( 'init', 'my_custom_post_procedimentos' ); ?> 

и это цикл single-processimentos.php:

 <?php get_header(); ?> <div class="contcolsopen"> <div class="post"> <?php if(have_posts()) : ?> <?php while(have_posts()) : the_post(); ?> <?php the_title(); ?> <?php the_content(); ?> <?php endwhile; ?> <?php endif; ?> </div><!--post-end--> </div><!--contcolsopen-end--> <?php get_footer(); ?> 

Я использую /% category% /% postname% / как структуру постоянных ссылок, но не сигару.

Итак: когда у меня есть пользовательский тип сообщения, чтобы отобразить их список на первой странице, где каждый элемент списка (perma) ссылается на соответствующую отдельную страницу, какова структура цикла для единственного [cpt] и страницы – [CPT]?

Пожалуйста, дайте мне знать, если я не буду достаточно ясным.

Заранее спасибо.

Эта часть относится к любезному запросу @ Warwick на комментарий ниже:

 object(WP_Query)#168 (47) { ["query_vars"]=> array(58) { ["page"]=> int(0) ["procedimento"]=> string(36) "prostatectomia-radical-laparoscopica" ["post_type"]=> string(12) "procedimento" ["name"]=> string(36) "prostatectomia-radical-laparoscopica" ["error"]=> string(0) "" ["m"]=> int(0) ["p"]=> int(0) ["post_parent"]=> string(0) "" ["subpost"]=> string(0) "" ["subpost_id"]=> string(0) "" ["attachment"]=> string(0) "" ["attachment_id"]=> int(0) ["static"]=> string(0) "" ["pagename"]=> string(0) "" ["page_id"]=> int(0) ["second"]=> string(0) "" ["minute"]=> string(0) "" ["hour"]=> string(0) "" ["day"]=> int(0) ["monthnum"]=> int(0) ["year"]=> int(0) ["w"]=> int(0) ["category_name"]=> string(0) "" ["tag"]=> string(0) "" ["cat"]=> string(0) "" ["tag_id"]=> string(0) "" ["author_name"]=> string(0) "" ["feed"]=> string(0) "" ["tb"]=> string(0) "" ["paged"]=> int(0) ["comments_popup"]=> string(0) "" ["meta_key"]=> string(0) "" ["meta_value"]=> string(0) "" ["preview"]=> string(0) "" ["s"]=> string(0) "" ["sentence"]=> string(0) "" ["fields"]=> string(0) "" ["menu_order"]=> string(0) "" ["category__in"]=> array(0) { } ["category__not_in"]=> array(0) { } ["category__and"]=> array(0) { } ["post__in"]=> array(0) { } ["post__not_in"]=> array(0) { } ["tag__in"]=> array(0) { } ["tag__not_in"]=> array(0) { } ["tag__and"]=> array(0) { } ["tag_slug__in"]=> array(0) { } ["tag_slug__and"]=> array(0) { } ["ignore_sticky_posts"]=> bool(false) ["suppress_filters"]=> bool(false) ["cache_results"]=> bool(true) ["update_post_term_cache"]=> bool(true) ["update_post_meta_cache"]=> bool(true) ["posts_per_page"]=> int(10) ["nopaging"]=> bool(false) ["comments_per_page"]=> string(2) "50" ["no_found_rows"]=> bool(false) ["order"]=> string(4) "DESC" } ["tax_query"]=> NULL ["meta_query"]=> object(WP_Meta_Query)#224 (2) { ["queries"]=> array(0) { } ["relation"]=> NULL } ["post_count"]=> int(1) ["current_post"]=> int(-1) ["in_the_loop"]=> bool(false) ["comment_count"]=> int(0) ["current_comment"]=> int(-1) ["found_posts"]=> int(1) ["max_num_pages"]=> int(0) ["max_num_comment_pages"]=> int(0) ["is_single"]=> bool(true) ["is_preview"]=> bool(false) ["is_page"]=> bool(false) ["is_archive"]=> bool(false) ["is_date"]=> bool(false) ["is_year"]=> bool(false) ["is_month"]=> bool(false) ["is_day"]=> bool(false) ["is_time"]=> bool(false) ["is_author"]=> bool(false) ["is_category"]=> bool(false) ["is_tag"]=> bool(false) ["is_tax"]=> bool(false) ["is_search"]=> bool(false) ["is_feed"]=> bool(false) ["is_comment_feed"]=> bool(false) ["is_trackback"]=> bool(false) ["is_home"]=> bool(false) ["is_404"]=> bool(false) ["is_comments_popup"]=> bool(false) ["is_paged"]=> bool(false) ["is_admin"]=> bool(false) ["is_attachment"]=> bool(false) ["is_singular"]=> bool(true) ["is_robots"]=> bool(false) ["is_posts_page"]=> bool(false) ["is_post_type_archive"]=> bool(false) ["query_vars_hash"]=> string(32) "1d123a103cba5a796526d6ce635a1001" ["query_vars_changed"]=> bool(false) ["thumbnails_cached"]=> bool(false) ["query"]=> array(4) { ["page"]=> string(0) "" ["procedimento"]=> string(36) "prostatectomia-radical-laparoscopica" ["post_type"]=> string(12) "procedimento" ["name"]=> string(36) "prostatectomia-radical-laparoscopica" } ["request"]=> string(184) "SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'prostatectomia-radical-laparoscopica' AND wp_posts.post_type = 'procedimento' ORDER BY wp_posts.post_date DESC " ["posts"]=> &array(2) { [0]=> object(WP_Post)#234 (24) { ["ID"]=> int(20) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2013-03-12 13:55:55" ["post_date_gmt"]=> string(19) "2013-03-12 13:55:55" ["post_content"]=> string(2188) "Vivamus nec i'm in the shizzle egizzle nisi mah nizzle pretizzle. Vivamizzle sit amizzle lacus. Nam for sure nisl lacus auctor boom shackalack. Shizzlin dizzle suscipit things ipsizzle. Mammasay mammasa mamma oo sa in mammasay mammasa mamma oo sa. Vestibulum enim enizzle, ass sizzle, ma nizzle pizzle, cool ma nizzle, check out this. Nullam vitae pede break it down erizzle mah nizzle pharetra. Quisque pede phat, ma nizzle pulvinizzle, doggy a, mollis black shit, yo mamma. Donizzle at dui. You son of a bizzle risus purus, elementum consectetuer, sollicitudizzle gangster, consequizzle imperdizzle, dizzle. Black away things eu mi rutrum cool. Curabitur da bomb sagittizzle ipsum. Pimpin' funky fresh morbi yo mamma senectizzle fo shizzle netus ghetto malesuada yo mamma fo shizzle turpis i'm in the shizzle. My shizz est. Fo shizzle elementum. Ut erizzle felizzle, crackalackin rizzle, suscipizzle ac, shut the shizzle up check it out, nisl. For sure sagittizzle gravida velizzle. The bizzle posuere auctizzle maurizzle. Sizzle a rizzle ut crunk its fo rizzle tincidunt. Maecenas mah nizzle fo. Boom shackalack izzle daahng dawg shut the shizzle up maurizzle elementizzle ass. Nunc izzle check it out sit amizzle fo shizzle my nizzle ultricizzle fo shizzle. In velizzle tortizzle, dang izzle, bizzle quizzle, adipiscing quizzle, i'm in the shizzle. The bizzle crazy leo, aliquam consequizzle, shizzle my nizzle crocodizzle nizzle, dictum sed, turpizzle. Dope fo shizzle. Crizzle hizzle. Prizzle vitae sheezy fizzle libero pizzle adipiscing. Ghetto izzle phat eu nibh ullamcorper cool. Fizzle rizzle sapizzle nizzle erat. Suspendisse lorizzle shit, sollicitudin sed, mattizzle izzle, dope nec, justo. Doggy shizznit ligula. Own yo' feugiat, bling bling a funky fresh tempizzle, bling bling metizzle tincidunt ante, dang dapibizzle pede boofron shizzlin dizzle we gonna chung. Phasellus quizzle pimpin', imperdiet id, tempus crunk, sempizzle we gonna chung, sapizzle. Ut mollizzle sizzle vizzle shut the shizzle up. Sizzle ante nibh, you son of a bizzle go to hizzle, vestibulizzle daahng dawg, funky fresh eu, velit. Sizzle a away. Dope nizzle magna sizzle dang risus ghetto congue." ["post_title"]=> string(48) "Pieloplastia Laparoscópica e Obstrução de JUP" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(45) "pieloplastia-laparoscopica-e-obstrucao-de-jup" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2013-03-12 13:55:55" ["post_modified_gmt"]=> string(19) "2013-03-12 13:55:55" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(55) "http://localhost:8888/?post_type=procedimento&p=20" ["menu_order"]=> int(0) ["post_type"]=> string(12) "procedimento" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [1]=> object(WP_Post)#235 (24) { ["ID"]=> int(19) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2013-03-12 13:51:38" ["post_date_gmt"]=> string(19) "2013-03-12 13:51:38" ["post_content"]=> string(601) "Lorizzle ipsum dolizzle ma nizzle amizzle, izzle adipiscing dope. Nullam sapizzle velizzle, shizznit volutpizzle, suscipizzle quizzle, fo shizzle mah nizzle fo rizzle, mah home g-dizzle vizzle, arcu. Pellentesque gizzle tortor. Dope erizzle. Yippiyo fo dolor dapibus turpis tempizzle dizzle. Mauris check it out nibh izzle gangster. Pizzle break yo neck, yall sheezy. Brizzle fo shizzle rhoncizzle nisi. In you son of a bizzle habitasse platea dictumst. Sure dapibizzle. Curabitizzle tellus urna, pretium eu, mattizzle ac, eleifend vitae, nunc. Dang suscipizzle. Integer semper things fizzle purizzle." ["post_title"]=> string(37) "Prostatectomia Radical Laparoscópica" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(36) "prostatectomia-radical-laparoscopica" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2013-03-13 13:12:58" ["post_modified_gmt"]=> string(19) "2013-03-13 13:12:58" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(55) "http://localhost:8888/?post_type=procedimento&p=19" ["menu_order"]=> int(0) ["post_type"]=> string(12) "procedimento" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } } ["post"]=> object(WP_Post)#226 (24) { ["ID"]=> int(19) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2013-03-12 13:51:38" ["post_date_gmt"]=> string(19) "2013-03-12 13:51:38" ["post_content"]=> string(601) "Lorizzle ipsum dolizzle ma nizzle amizzle, izzle adipiscing dope. Nullam sapizzle velizzle, shizznit volutpizzle, suscipizzle quizzle, fo shizzle mah nizzle fo rizzle, mah home g-dizzle vizzle, arcu. Pellentesque gizzle tortor. Dope erizzle. Yippiyo fo dolor dapibus turpis tempizzle dizzle. Mauris check it out nibh izzle gangster. Pizzle break yo neck, yall sheezy. Brizzle fo shizzle rhoncizzle nisi. In you son of a bizzle habitasse platea dictumst. Sure dapibizzle. Curabitizzle tellus urna, pretium eu, mattizzle ac, eleifend vitae, nunc. Dang suscipizzle. Integer semper things fizzle purizzle." ["post_title"]=> string(37) "Prostatectomia Radical Laparoscópica" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(36) "prostatectomia-radical-laparoscopica" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2013-03-13 13:12:58" ["post_modified_gmt"]=> string(19) "2013-03-13 13:12:58" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(55) "http://localhost:8888/?post_type=procedimento&p=19" ["menu_order"]=> int(0) ["post_type"]=> string(12) "procedimento" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } ["queried_object"]=> object(WP_Post)#226 (24) { ["ID"]=> int(19) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2013-03-12 13:51:38" ["post_date_gmt"]=> string(19) "2013-03-12 13:51:38" ["post_content"]=> string(601) "Lorizzle ipsum dolizzle ma nizzle amizzle, izzle adipiscing dope. Nullam sapizzle velizzle, shizznit volutpizzle, suscipizzle quizzle, fo shizzle mah nizzle fo rizzle, mah home g-dizzle vizzle, arcu. Pellentesque gizzle tortor. Dope erizzle. Yippiyo fo dolor dapibus turpis tempizzle dizzle. Mauris check it out nibh izzle gangster. Pizzle break yo neck, yall sheezy. Brizzle fo shizzle rhoncizzle nisi. In you son of a bizzle habitasse platea dictumst. Sure dapibizzle. Curabitizzle tellus urna, pretium eu, mattizzle ac, eleifend vitae, nunc. Dang suscipizzle. Integer semper things fizzle purizzle." ["post_title"]=> string(37) "Prostatectomia Radical Laparoscópica" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(36) "prostatectomia-radical-laparoscopica" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2013-03-13 13:12:58" ["post_modified_gmt"]=> string(19) "2013-03-13 13:12:58" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(55) "http://localhost:8888/?post_type=procedimento&p=19" ["menu_order"]=> int(0) ["post_type"]=> string(12) "procedimento" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } ["queried_object_id"]=> int(19) } 

Solutions Collecting From Web of "Постоянная ссылка для отдельных не работает"

Попробуйте этот цикл. вам нужно использовать тег шаблона the_permalink() чтобы получить ссылку на отдельные элементы.

Также, используя класс WP_Query для захвата WP_Query сообщений. В текущем запросе ниже будут представлены последние 10 опубликованных сообщений о процедурах. Если вы хотите изменить количество сообщений или что-то подобное, вы можете увидеть аргумент, который будет использоваться для WP_Query() здесь .

 $procedimentos_posts = new WP_Query( array( 'post_type' => 'procedimentos', 'post_status' => 'publish' )); if($procedimentos_posts->have_posts()) : while($procedimentos_posts->have_posts()) : $procedimentos_posts->the_post(); echo '<a href="' . get_the_permalink() . '">' . get_the_title() . '</a>'; the_content(); endwhile; endif; wp_reset_postdata();