JordanBarber
JordanBarber

Reputation: 2101

Use Custom Post Archive Page for a specific Custom Post

I'm stuck on this issue with my Wordpress setup. My current setup is as follows: I have a custom post type "degrees" that are categorized by undergraduate, graduate, online, and abroad. The initial page is a specific taxonomy template I have set up for the user to specify which degrees to look through. Once a category is selected, the user will come to a landing page with all graduate programs, etc. This page is handled in the backend as a archive-degrees.php. Then, upon selecting a program, the template used is single-degrees.php. My problem is that I have one program (currently using the single-degress.php) that I would like to use the archive page as it needs to list out sub-programs. I hope that makes sense. Basically, I need this one specific Custom Post to use the archive page and then the single page for its sub-children. I am not sure if there is a way to do this. Any help will be much appreciated.

Upvotes: 0

Views: 47

Answers (1)

rnevius
rnevius

Reputation: 27092

You're referring to specialized page templates. Your best bet is to create a new template for this page specifically.

From the Codex:

Create a template for one Page: For more extensive changes, intended for just one specific Page, you can create a specialized template file, named with that Page's slug or ID:

  1. page-{slug}.php
  2. page-{ID}.php

For example: Your About page has a slug of 'about' and an ID of 6. If your active Theme's folder has a file named page-about.php or page-6.php, then WordPress will automatically find and use that file to render the About page

Upvotes: 1

Related Questions