• Hello Forum,

    I have set up a website with my own theme built up from the Starkers theme. I have one additional page template in use that I am using for the Home page, as well as for all the other pages, and the last page is supposed to be the blog:

    Home – About – Blub – Blob – Blip – Contact – BLOG

    This last stupid blog page is not working out. I got everything set up and styled the way I want it, the archives.php page, the single.php page, all that, just that one page withe the Index of all current blog posts is not working out, all it is givin me is a blank page (well a blank content area) with the pages title (“Blog”) displayed, the posted-on blabla component, and then nothing.

    How do I set up this stupid blog index page? Here’s the code I have for the page.php template (as well as the index.php):

    <?php get_header(); ?>
    <div class="page-blog">
    	<?php get_sidebar(); ?>
    	<div class="blogcontainer">
    		<?php get_template_part( 'loop', 'index' ); ?>
    	</div>
    </div>
    <?php get_footer(); ?>

    What in this small line is not correct?

    Thanks a zillion in advance! I’m very very desperate.

    Flow

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey,
    It could help to take a look here:
    http://codex.wordpress.org/Function_Reference/get_template_part

    Your index loop is included through either one of those sites, in this priority:

    1.) wp-content/themes/twentytenchild/loop-index.php
    2.) wp-content/themes/twentytenchild/loop.php
    3.) wp-content/themes/twentyten/loop-index.php
    4.) wp-content/themes/twentyten/loop.php

    That means you have to look for the loop-index.php or the loop.php site in your theme folder or if it doesn’t exist in your parent theme folder (you can also just create it if it doesn’t exist in your folder) and edit it, put all the stuff you want in your loop there. And also don’t forget to set up the loop itself because it’s not done in the code you showed us above 🙂

    Help for the loop: http://codex.wordpress.org/The_Loop
    Good Luck!

    Thread Starter flow_berlin

    (@flow_berlin)

    Hey Fyn,

    thanks for your fast reply! Yes, I have the loop.php set up and it’s the standard thing from twentyten, so I don’t think it’s that.

    I copied the code directly from the index.php file from twentyten, and in the comments it said that this would output an index of the posts.

    Thanks,
    Flow

    In the settings > Reading, did you select, use a static front page and then selected the page blog to display your posts?

    Thread Starter flow_berlin

    (@flow_berlin)

    Christine, thanks for your reply! In the settings, I have one of the other pages (with the custom.php as template) set as the static front page.

    The loop, is working perfectly for archive pages and category pages etc., when it’s triggered with this get_template_part( 'loop', 'category' );

    line. Why is it not working with the index thingie?

    In your Settings under Reading, you have 2 check boxes…
    Your latest posts
    A static page with 2 dropdowns.

    The second radio button should be checked.
    Then you pick your home page or whatever page you want to use as home and then your page called blog.

    Your home page should use the front-page.php or home.php
    Your blog will use the index.php

    Thread Starter flow_berlin

    (@flow_berlin)

    Ah wow! That is not very clear, that you have to set your blog page in the submenu of where you define what your front page is… How come I didn’t find out about this myself…

    Thanks a million, Christine, you ended a sequence of a few days without sleep. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How do I create a Blog Index page?’ is closed to new replies.