I am trying to apply a template to a Custom Post Type
in Wordpress
. Currently I am displaying a list of Custom Post Types
on a seperate page and I'm using the permalink
for each post as the URL
to go to when a link is clicked.
Code to generate the links:
<a href="<? echo get_post_permalink() ?>"><h2><?php the_title(); ?></h2></a>
This redirects me to a page with a URL
like this:
http://xxx.xxx/?pa_supplier=xyz-packaging-ltd
I am wondering how I could customize how this page might look.
I know for pages
you can create a php
file called page-id.php and subsitute the page id in and that will allow for customization, can something similar be done to Custom Post Types
?
Simply create a new template file in the theme folder and name it with following syntax: single-[post-type_slug].php, for example. If we have a post-type named "projects", the file for displaying a single projects post would be "single-projects.php".
Check the following link for more information: http://codex.wordpress.org/Template_Hierarchy