Skip to content

Instantly share code, notes, and snippets.

@takatoshi
Created June 12, 2012 17:47
Show Gist options
  • Select an option

  • Save takatoshi/2918990 to your computer and use it in GitHub Desktop.

Select an option

Save takatoshi/2918990 to your computer and use it in GitHub Desktop.
//変更前
<ul>
<?php while ($r->have_posts()) : $r->the_post(); ?>
<li><a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a></li>
<?php endwhile; ?>
</ul>
//変更後
<ul>
<?php while ($r->have_posts()) : $r->the_post(); ?>
<li>
<a href="<?php the_permalink() ?>"><?php the_post_thumbnail(array(60,60)); ?></a>
<a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>" class="recent_title"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a>
</li>
<?php endwhile; ?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment