What is the best approach to create Pages with same Page Template but different post types?

The goal is to have something like this below in WordPress:

Three pages :

Cars
Movies
Fruits

Three Post Types

cars_posts
movies_posts
fruits_posts

Each Post Types have multiple posts

cars_posts

Volkswagen
Porsche
Ford

movies_posts

Interstellar
Guardians of the Galaxy
Movie 3

fruits_posts

Apple
Blackberry
Mango

Now, there is a single Template to display all of these called – list_elements.php

with

<?php
/*
Template Name: list_elements
*/
?>

How can I use only list_elements template to display the Post Types cars_posts, movies_posts, fruits_posts on pages Cars, Movies and Fruits respectively?

Any approach to achieve this would be appreciated. Thanks in advance!

Read more here:: What is the best approach to create Pages with same Page Template but different post types?

Leave a Reply

Your email address will not be published. Required fields are marked *