• Hello everybody,
    I’ve created a custom post type, but without any taxonomy as I don’t need any category nor tag.
    Now, I’d like to have a page displaying the list of all custom posts but can’t get it. The standard patterns archive-[…].php taxnomoy-[…].php don’t work.
    Any idea?

    My code

    register_post_type( 'members',
    			array(
    				'labels' => array(
    					'name' => __( 'Team' ),
    					'singular_name' => __( 'Member' ),
    					'add_new_item'       => 'Add New Member',
    					'edit_item'          => 'Edit Member',
    					'new_item'           => 'New Member',
    					'all_items'          => 'All Members',
    					'view_item'          => 'View this page',
    					'search_items'       => 'Search Members'
    				),
    			'menu_position' => 5,
    			'public' => true,
    			'has_archive' => false,
    			'supports' => array('title', 'thumbnail', 'excerpt', 'revisions'),
    			'rewrite' => array( 'slug' => 'members','with_front' => false),
    			)
    		);

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    You could try wp_list_pages where you filter by custom post type.

    https://codex.www.ads-software.com/Function_Reference/wp_list_pages

    Hope this helps ??

    Thread Starter synthview

    (@synthview)

    Well, in fact I’ve already created a page with a custom template and made it list my custom posts inside. The main drawback is I see this page on my “pages” list and I feel it could be confusing for the CMS’s administrators.
    For this reason I’m trying to use a built-in archive or taxonomy php page (to hide it and avoid any potentially hurting action, like deleting the page, breaking dependencies, etc.)
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘filename pattern to list custom post type WITHOUT any taxonomy?’ is closed to new replies.