0

I use Pinboard theme (it has a very complicated structure, but it is nice).

Image how it works Select a template in this way it changes for all posts, pages, etc. and do not give you more choice.

I tried experimenting with index file but it is too confusing for me.

<?php get_header(); ?>
<?php if( is_home() && ! is_paged() ) : ?>
    <?php if( pinboard_get_option( 'slider' ) ) : ?>
        <?php get_template_part( 'slider' ); ?>
    <?php endif; ?>
    <?php get_sidebar( 'wide' ); ?>
    <?php get_sidebar( 'boxes' ); ?>
<?php elseif( ( is_home() && is_paged() ) || ( ! is_home() && pinboard_get_option( 'location' ) ) ) : ?>
    <?php pinboard_current_location(); ?>
<?php endif; ?>
<div id="container">
    <section id="content" <?php pinboard_content_class(); ?>>
        <?php if( is_category( pinboard_get_option( 'portfolio_cat' ) ) || ( is_category() && cat_is_ancestor_of( pinboard_get_option( 'portfolio_cat' ), get_queried_object() ) ) ) : ?>
            <?php pinboard_category_filter( pinboard_get_option( 'portfolio_cat' ) ); ?>
        <?php endif; ?>
        <?php if( have_posts() ) : ?>
            <div class="entries">
                <?php while( have_posts() ) : the_post(); ?>
                    <?php get_template_part( 'content', get_post_format() ); ?>
                <?php endwhile; ?>
            </div><!-- .entries -->
            <?php pinboard_posts_nav(); ?>
        <?php else : ?>
            <?php pinboard_404(); ?>
        <?php endif; ?>
    </section><!-- #content -->
    <?php if( 'no-sidebars' != pinboard_get_option( 'layout' ) && 'full-width' != pinboard_get_option( 'layout' ) && ! is_category( pinboard_get_option( 'portfolio_cat' ) ) && ! ( is_category() && cat_is_ancestor_of( pinboard_get_option( 'portfolio_cat' ), get_queried_object() ) ) ) : ?>
        <?php get_sidebar(); ?>
    <?php endif; ?>
    <div class="clear"></div>
</div><!-- #container -->

I made front-page.php with the code from template-blog-full-width.php

<?php get_header(); ?>
<?php global $pinboard_page_template; ?>
<?php $pinboard_page_template = 'template-blog-full-width.php'; ?>
<?php if( pinboard_get_option( 'location' ) ) : ?>
    <?php pinboard_current_location(); ?>
<?php endif; ?>
<div id="container">
    <section id="content" class="column onecol">
        <?php $args = array( 'posts_per_page' => get_option( 'posts_per_page' ), 'paged' => max( 1, get_query_var( 'paged' ) ) ); ?>
        <?php if( pinboard_get_option( 'blog_exclude_portfolio' ) ) : ?>
            <?php $args['cat'] = '-' . pinboard_get_option( 'portfolio_cat' ); ?>
        <?php endif; ?>
        <?php global $wp_query, $wp_the_query; ?>
        <?php $wp_query = new WP_Query( $args ); ?>
        <?php if( $wp_query->have_posts() ) : ?>
            <div class="entries">
                <?php while( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
                    <?php get_template_part( 'content', get_post_format() ); ?>
                <?php endwhile; ?>
            </div><!-- .entries -->
            <?php pinboard_posts_nav(); ?>
        <?php else : ?>
            <?php pinboard_404(); ?>
        <?php endif; ?>
        <?php wp_reset_postdata(); ?>
        <?php $wp_query = $wp_the_query; ?>
    </section><!-- #content -->
    <div class="clear"></div>
</div><!-- #container -->

But it looks bad my site

I would like to have a home page template: template-blog-full-width.php and the rest would be defined by the options.

If anything is unclear, I'll try to explain.

1

1 Answer 1

2

I assume that template-blog-full-width.php is a page template and that you'd like to use this page template as the template to be used on the homepage.

What you can do is to create a copy of the template-blog-full-width.php template and name the copy front-page.php.

That's about it. WordPress will always use front-page.php template when on the homepage/frontpage of your website.

And just a side note

You might want to implement your changes by creating a Child Theme first so that any updates to the parent theme won't remove your changes..

1
  • That did't work well, the site have bugs. :( But thanx for concern.
    – Szuta
    Commented Jan 18, 2013 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.