Multiple templates for custom post type

Question

This is my setup: I have one post type called “products” and a page (page X) where I use wp_query to list all products, the_permalink(); returns the link to single-products.php.

The goal is to use wp_query on another page (page Y) and list all products but the permalink should now be linked to another template, single-products2.php for example.

Basically I need two templates for the same custom post type.

0
Felix 3 months 0 Answers 12 views 0

Leave an answer