How to know if a page template is being used?
-
I am dabbling in the mysteries of front-page.php and home.php.
Here’s my scenario:
I have front-page.php. I also have home.php. Now, the user, in her innocence, goes to Setting>Reading and sets the Front Page to be a static page and set the Blog Posts page to be “Blog Home”.But I want to give more than one option for front page layouts. So I have front-page.php, and I have another-template-for-fp.php. The user makes a front page, sets the template to another-template-for-fp.php.
The user, in her innocence, goes to Setting>Reading and set the front page to be a static page. The same static page that is based on the template another-template-for-fp.php.
WordPress of course keeps using front-page.php.
I have used Chip Bennet’s advice (isn’t he a great guy!?!) and have the following code in my front-page.php
if ( 'posts' == get_option( 'show_on_front' ) ) { /* * Checks if the blog posts is set to display as front page, so calling home.php instead */ include( get_home_template() ); } else { //show the front-page.php stuff }
But how on earth do I show the template another-template-for-fp.php ? WP defaults to front-page.php, regardless of the love that is present elsewhere!? Help please!
- The topic ‘How to know if a page template is being used?’ is closed to new replies.