• I’m having this problem over and over again, when developing WP sites at the moment. Lets say, I have a custom post type called references. I’ll then like to have an archive page showing all the references. What is the best way of doing so?

    On my last projects, I’ve created a custom reference template (template-reference.php), creating a reference page and assigning this template to the page. What are you guys doing?

    I found this plugin: https://www.ads-software.com/extend/plugins/custom-post-type-archives/. It this the way to go?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter DennisMadsen

    (@dennismadsen)

    Someone? There must be other users having the same issue.

    You just want a page showing all the custom post type posts?

    I just made a copy of index.php, called it products.php (in my case it was for a shop) and added this query above the loop

    query_posts( array(
    	// Set post type
    	'post_type' => 've_products',
    	// Enabled paging
    	'paged'=> ( get_query_var('paged') ? get_query_var('paged') : 1 ),
    ));

    (my custom post type was named ve_products)

    Of course added in the page template header, then made a page named products, and assigned it that template

    What about when you have taxonomies for that custom post type? If I have a post type with the slug “products” and taxonomies for them, and then add a normal page with the slug “products” (to list content like above), then /products/the-taxonomy(ex “health”)/the-productname won’t work. I guess this is because he now looks for sub pages for the product page?

    So much trouble with custom post types and taxonomies, hopefully there is a solution for this.

    I would love to be able to set it up so I can go to /products/ for listing stuff, then use /products/health (where health is a taxonomy) to list all stuff with that assigned to it. Can’t get it to work though, any ideas?

    Initiation of taxonomy before the custom post type solved the first part of my problem.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Archives for Custom Post Type?’ is closed to new replies.