Dissection of a WordPress theme: Part 1
After sidebar change
Lets take a look at our site with the new style:
Its getting there, but the sidebar is on the right of the footer and not the content.
We need to re-arrange the basic structure and move the PHP function call that displays the sidebar to before the code for the posts (so it is to the right of the posts and not the right of the footer).
Edit index.php and move get_sidebar () on line 43 to line 3:
- <?php get_header(); ?>
- <?php get_sidebar(); ?>
- <div id="content" class="narrowcolumn">
- <?php if (have_posts()) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <div class="post">
- <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
- <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
- <div class="entry">
- <?php the_content('Read the rest of this entry »'); ?>
- </div>
- <p class="postmetadata">Posted in <?php the_category(', ') ?> <strong>|</strong> <?php edit_post_link('Edit','','<strong>|</strong>'); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
- <!--
- <?php trackback_rdf(); ?>
- -->
- </div>
- <?php endwhile; ?>
- <div class="navigation">
- <div class="alignleft"><?php posts_nav_link('','','« Previous Entries') ?></div>
- <div class="alignright"><?php posts_nav_link('','Next Entries »','') ?></div>
- </div>
- <?php else : ?>
- <h2 class="center">Not Found</h2>
- <p class="center"><?php _e("Sorry, but you are looking for something that isn't here."); ?></p>
- <?php include (TEMPLATEPATH . "/searchform.php"); ?>
- <?php endif; ?>
- </div>
- <?php get_sidebar (); ?>
- <?php get_footer(); ?>
Help me to save time by reading these instructions!
If you are asking a question please read the FAQ to see if it has already been answered. All support questions should be directed to the support forum. Thanks!







Comments
Comments are shown on the first page.