[wp-trac] [WordPress Trac] #42926: Archive page don't work

WordPress Trac noreply at wordpress.org
Sun Dec 17 16:37:16 UTC 2017


#42926: Archive page don't work
-------------------------------+-----------------------------
 Reporter:  sebastian.pisula   |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  4.9.1
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 Hi,

 I want register CPT "FAQ". All is OK but this CPT will be have only
 archive without singular page. I register CPT on `init` hook:

 {{{#!php
 <?php
 register_post_type( 'ic-faq', [
                         'label'               => 'FAQ',
                         'supports'            => array( 'title', 'editor'
 ),
                         'hierarchical'        => false,
                         'public'              => true,
                         'show_ui'             => true,
                         'show_in_menu'        => true,
                         'menu_position'       => 5,
                         'menu_icon'           => 'dashicons-editor-help',
                         'show_in_admin_bar'   => true,
                         'show_in_nav_menus'   => false,
                         'can_export'          => true,
                         'has_archive'         => 'faq',
                         'exclude_from_search' => true,
                         'publicly_queryable'  => false,
                         'capability_type'     => 'post',
                 ] );
 }}}

 After I add new post in FAQ "view post" in table row is disable and this
 is OK but in Admin Bar I have button "View posts" (with url
 http://example.com/faq/) and when I click then I was redirected to home
 page. I think that this is bug and this problem have two way to resolve:
 1. In admin bar link "view posts" should be removed;
 2. Archive should work ;-)

 I think that archive should work. Maybe I'm doing something bad? Or maybe
 this work differently than I think?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42926>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list