• Resolved roburdick

    (@roburdick)


    I would like to use a static front page using wp ‘pages’ and still be able to use the original layout for a page showing my blog posts (i think this would have been index.php).

    This is how my page template code looks:

    <?php
    /*
    Template Name: blog
    */
    ?>
    <?php
    global $options;
    foreach ($options as $value) {
    if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; }
    else { $$value['id'] = get_option( $value['id'] ); }
    }
    ?>
    <?php get_header() ?>
    
    <div id="container">
    <div id="content">
    
    <?php thematic_navigation_above();?>
    
    <?php get_sidebar('index-top') ?>
    
    <?php thematic_above_indexloop() ?>
    
    <?php thematic_indexloop() ?>
    
    <?php thematic_below_indexloop() ?>
    
    <?php get_sidebar('index-bottom') ?>
    
    <?php thematic_navigation_below();?>
    
    </div><!-- #content -->
    </div><!-- #container -->
    
    <?php thematic_sidebar() ?>
    <?php get_footer() ?>

    As lifted from the index.php, so it should show all posts like the default layout did before assigning a static page as my front page. It shows nothing but the title and a comment box.
    http://www.marrymeweddingfair.co.uk/pc_newsite/?page_id=22

    I have tried making a template using the loop from wordpress codex: http://codex.wordpress.org/Pages#A_Page_of_Posts
    But this does not have any markup for the css to work. When I try to edit it, I have limited success from hours of trial and error. There must a better solution, maybe using funtions.php, which I have dabbled with, but I found it hard to understand.

    Thanks in advance for anyone who has read this far, hope I explained this well.
    Rob 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi

    The simplest approach to what you are after is create a custom page template, copy the code from index.php into the new custom page template.

    Then assign the WP page that you want to use as your static home page to use the custom page template. Then add it as the static home page in Settings/Reading.

    Here is info on custom page templates:
    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    Here’s a tutorial article I found on Google:
    http://www.expand2web.com/blog/custom-page-template-wordpress/

    Thread Starter roburdick

    (@roburdick)

    Thanks, it turns out after a reinstall of thematic and doing exactly as you said it all works now. I must have done something to me copy of thematic, although I was using a child theme and trying not to touch the files in thematic other than a bit of copy and paste!

    Anyway resolved, anyone else suffering a similar block, I would say try a re-install of the parent theme.

    Rob 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using a page template to show ‘a page of posts’’ is closed to new replies.