Abhimanue Tamang
Abhimanue Tamang

Reputation: 580

How to create a costum template structure like for pages and post but for different entities like hotels, products etc

Hi everyone I am creating a wordpress theme and a custom plug-in which is related to hotel booking and display the information on the front end entered in the back end in admin panel of wordpress . so friends whenever a post is displayed the url is like http://localhost/wordpress/uncategorized/post10/ and the name of the post or id of the post changes in a url but at the back end only single.php template get used by wordpress again and again so my question is can wee create something like that for different things for example in my case to display hotel only hotel.php file get used again and again and in url only the id of the hotel changes .

I didn't searched much about this on internet but I have seen something like that in wp-e-commerce plugin in which there is a separate template files to display the categories of products and also for products and those files are in the plugin directory.

Upvotes: 2

Views: 154

Answers (1)

soju
soju

Reputation: 25312

You should first create custom post type (you will find plugins for that), for example a hotel post type.

Then you can easily create specific template for this post type, for example single-hotel.php.

More on codex :

http://codex.wordpress.org/Post_Types#Custom_Types

http://codex.wordpress.org/Post_Types#Template_Files

Upvotes: 0

Related Questions