Custom template for each page

there are a few way you can do that: Template Hierarchy – each page with is own theme file using page-{ID/slug}.php Custom Page Templates – Individual Pages can be set to use a specific custom Page Template from the edit screen. but if you are just looking to change whats on the sidebar then there … Read more

Can I create a page template, use it once, then hide/remove the option to use it again?

If a page won’t work without a specific template, I would just remove the need for them to select a template. Filter template_include and select the template based on the requested page: function wpse50455_template_include( $template ) { // check if it’s a page if ( is_page() ): $this_page_id = get_query_var( ‘page_id’ ); // check for … Read more

is_page_template & is_page in functions.php not working

Use wp_enqueue_scripts instead on init. This will ensure you the template is already loaded. add_action(‘wp_enqueue_scripts’, ‘maps_scripts’); Or you try to check the template using get_page_template_slug() instead of is_page_template: $tmp = get_page_template_slug($post_id); // provide page/post ID if(‘page-about.php’ == $tmp) { // enqueue scripts here } Note that you don’t need to register scripts before enqueueing them. … Read more

How to Set a Custom Template for Blog Posts

As I understand it, you can’t use Page Templates that way; you need to edit your index.php file instead. See this chart for more detail on how the hierarchy works and this post for a detailed explanation. By specifying “Blog” as the “posts page” on the Settings > Reading tab, you are telling WordPress “this … Read more