Support » Fixing WordPress » Boilerplate theme – index.php not showing everything???

  • I’m a newbie to WordPress. I’ve activated Boilerplate (and have a successful child theme based on it.) Problem is, my index.php seems to not have as much in it as it should!

    It basically runs the loop and calls the other pieces (header, footer, sidebar).

    I can find the css — that’s not the problem.

    The problem is: When I’m actually viewing the document online (well, through Wamp server), I say “view source” and it shows me things I’d like to edit/delete/add to. I just want to FIND these things in a file somewhere in the boilerplate theme. I expected these things would be in index.php but they’re not. I understand some of things are in the header, footer, sidebar, etc areas.

    What I think SHOULD be in index.php that isn’t in the one I downloaded:

    <!DOCTYPE html>
    <!–[if lt IE 7 ]><html dir=”ltr” lang=”en-US” class=”no-js ie ie6 lte7 lte8 lte9″><![endif]–>
    <meta charset=”UTF-8″ />
    <link rel=”stylesheet” href=”http://localhost/JP/wp-content/themes/boilerplate-child/style.css” />
    class=”current_page_item”>Home<li class=”page_item page-item-2″>Sample Page</div>

    You get the idea. Now I will copy and paste what my index.php actually has. Where’s the beef??? Thanks in advance, I know this question has an obvious answer but it’s driving me nuts.

    * The main template file.
    * This is the most generic template file in a WordPress theme
    * and one of the two required files for a theme (the other being style.css).
    * It is used to display a page when nothing more specific matches a query.
    * E.g., it puts together the home page when no home.php file exists.
    * Learn more:
    * @package WordPress
    * @subpackage Boilerplate
    * @since Boilerplate 1.0

    get_header(); ?>

    /* Run the loop to output the posts.
    * If you want to overload this in a child theme then include a file
    * called loop-index.php and that will be used instead.
    get_template_part( ‘loop’, ‘index’ );

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Well I’ll have a go here but I am a complete PHP numpty, trying to figure out how to drive WordPress which feels to me like a lorry with no brakes!

    The index.php file is obviously calling the header.php and the loop.php. It’s the loop.php that has the real meat and that will call all kinds of other things too. The loop here is in three main sections that will respond to different post types, gallery category, asides category and all other posts. After that things get a bit hazy. I’d suggest that it is in there that you want to think about how your page gets rendered.

    What you might try doing is taking a look at other themes that use a similar loop and see how they add elements to it. That’s what I am trying. I think that Boilerplate is based on Twentyten?

    If that’s not helping then I am as stuck/more stuck than you. I’m just having a go.

    Best of luck.


    Chip Bennett


    Theme Review Admin

    The get_header() function calls header.php.
    The get_template_part( 'loop', 'index' ) file calls loop-index.phploop.php`.
    The get_sidebar() function calls sidebar.php.

    Chip Bennett


    Theme Review Admin

    The get_header() function calls header.php.
    The get_template_part( 'loop', 'index' ) file calls loop-index.php or loop.php.
    The get_sidebar() function calls sidebar.php.
    The get_footer() function calls footer.php.

    You’ll find the markup you’re looking for in these template-part files.

    Thanks to both. I’m not quite sure why that was so hard for me to find the first, second, third, etc. times around. It’s clear as day now.

    And Hotmale, good luck with the lorry. Let’s just hope we don’t run into each other on the street since we’d definitely crash into each other! 😉

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Boilerplate theme – index.php not showing everything???’ is closed to new replies.