Let say i have 2 page in wordpress, Page A and Page B (please notice this is Pages not Posts).
as default wordpress will use page.php
as the template for page.
but now i want to make it like this.
Page A will use template page.php
and page B will use template page-new.php
how i can make that in wordpress?
Copy the page template, change its name in the comment
When editing a page in
wp-admin
, on the right side is a combo named Template. Your template should show up there automatically, you can pick the template on page by page basis.You don’t even need to use a page template, simply create a template file for that specific page, you can do this using the ID or the slug of the page.
Copy your page.php file and name it either.
a) page-n.php
– where n is the page’s numeric ID
b) page-name.php
– where name is the page’s name(or slug at least, ie the nice version, lowercase and hypens)
All this works inline with the WordPress template hierarchy.
http://codex.wordpress.org/Template_Hierarchy
See the image on the above link for a visual representation of how the template hierarchy determines which file to load.