Loop after page content

Updating a theme isn’t that hard. But it’s necessary to let it play nice with the current version of the core.

Here’re some notes on what you might need to do:

  • Query
  • Templates
  • Post Thumbnails & featured images

The query

Nowadays, we’re using get_posts() or new WP_Query for such cases, where you need to do another (manual) query aside from WordPress’ default query.

So you’d call:

$wpse69629_query = new WP_Query( array(
    'cat'   => 8
   ,'paged' => get_query_var('paged') ? get_query_var('paged') : 1;
) );
if ( $wpse69629_query->have_posts() )
{
    while ( $wpse69629_query->have_posts() )
    {
        $wpse69629_query->the_post();

        // do stuff
    }
}

Template Hierarchy

As you have a query that does nothing than loading posts from a specific category, you might consider adding another template that triggers only for this category. This will save you an additional query.

Just copy your code (without the query, but with a default loop) into a new file named category-8.php.

enter image description here

The post thumbnail

With (afaik) WP 2.9, post thumbnails/feat.images arrived. It just seems that this wasn’t implemented in your theme back then.

You can now grab the assigned thumbnail (featured image meta box) simply by calling the_post_thumbnail() in list views and () for single views.

The support for this feat. and the size will be set inside your functions php with something like that:

function wpse69629_feat_img_size()
{
    add_theme_support( 'post-thumbnails' ); 

    set_post_thumbnail_size( 50, 50 );
}
add_action( 'after_setup_theme', 'wpse69629_feat_img_size' );

You can then call it like this in the template:

<?php the_post_thumbnail('thumbnail', array('class' => 'alignleft')); ?>