I'm writing my first twenty twelve child theme and came across (what I think) is a strange quirk.
I modified front-page.php to have a slider using sliderjs, afterwards I decided I did not want to use this as a front page template, so I'd much prefer to call it something else for a different page.
To my surprise, the moment I renamed front-page.php to text-carousel.php and changed the Template Name in the docblock to something else the page changes from displaying my content in full width and the widgets below to a 2 column version similar to my blog, but with the widgets assigned to front-page.
So, is front-page.php a reserved template in twenty twelve? is it possible to duplicate its look and feel into a different template?
For reference here's my code:
<?php /** * Template Name: Text Carousel Page Template * * Description: A page template that provides a key component of WordPress as a CMS * by meeting the need for a carefully crafted introductory page. The front page template * in Twenty Twelve consists of a page content area for adding text, images, video -- * anything you'd like -- followed by front-page-only widgets in one or two columns. * * @package WordPress * @subpackage Twenty_Twelve * @since Twenty Twelve 1.0 */ get_header('nonav'); ?> <div id="primary" class="site-content"> <div id="content" role="main"> <div id="example"> <div id="slides"> <div class="slides_container"> <?php $args = array( 'posts_per_page' => 5, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'publish', 'suppress_filters' => true ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <div class="slide"> <h2><?php the_title(); ?></h2> <p><?php echo get_the_excerpt(); ?></p> <p><a href="<?php the_permalink(); ?>" class="link">Leer articulo</a></p> </div> <?php endforeach; ?> </div><!-- .slides_container --> </div><!-- #slides --> </div><!-- #example --> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar( 'front' ); ?> <?php get_footer(); ?>
It works fine if the file is called twentytwelve/page-templates/front-page.php with Template Name: Template Name: Front Page Template, but it goes 2 column as twentytwelve/page-templates/text-carousel.php with Template Name: Text Carousel Page Template
I had posted this question in stackoverflow, but it didn't seem to be getting too much success so I decided to open an account here and move it across.