今回は直接記述で書き換えます。
functions.phpを利用する場合の例はこちらです。
非推奨になっていたquery_postsをget_posts形式に書き換える
query_postsでのソースコード
<?php
query_posts("posts_per_page=5");
if ( have_posts() ) : while(have_posts()): the_post(); ?>
<li><a class="title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; endif; wp_reset_query(); ?>
↓
get_postsに変更したソースコード
<?php
$myposts = get_posts('posts_per_page=5');
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; wp_reset_postdata(); ?>


