[wp-hackers] Can I make a custom post type display with page.php rather than single.php

David F. Carr david at carrcommunications.com
Sat Oct 19 14:20:16 UTC 2013


I'd like to make my RSVPMaker event scheduling plugin a little more plug
and play, and it just occurred to me there might be a simpler way of
getting my event post type to display better.

I've been telling people to create a single-rsvpmaker.php template and add
it to their theme in order to avoid confusion between the event date
displayed in the body of the post and the post publication date that's
prominently displayed in many themes. In the absence of a
single-customtype.php template, WordPress normally uses the theme's
single.php or equivalent.

It occurs to me that most themes do not display the publication date as
prominently in the page template. So the behavior I'd like to achieve would
be to modify the choice of template to be:

First choice: single-rsvpmaker.php (if there is one)
Second choice: page.php
Third choice: default WordPress behavior.

That way, the user would only have to create a custom template file if
page.php is not appropriate. More people who don't feel comfortable mucking
around in code would get the desired behavior out of the box.

Is this doable? If so, can you give pointers on how to accomplish it?

-- 
David F. Carr
Author, Social Collaboration for Dummies
http://www.wiley.com/buy/9781118658543
LinkedIn - http://www.linkedin.com/in/davidfcarr
Facebook - http://www.facebook.com/carrcomm


More information about the wp-hackers mailing list