Posted By

psteinweber on 08/18/11


Tagged

wordpress sidebar posts recent


Versions (?)

Wordpress: Recent Posts Widget


 / Published in: PHP
 

  1. <h3><a href="<?php bloginfo( 'url' ); ?>/blog/">Neues aus dem Sonnenprojekt</a></h3>
  2.  
  3. <ul>
  4. <?php
  5. global $post;
  6. $args = array( 'numberposts' => 5 );
  7. $myposts = get_posts( $args );
  8. foreach( $myposts as $post ) : setup_postdata($post); ?>
  9. <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
  10. <?php endforeach; ?>
  11. </ul>

Report this snippet  

You need to login to post a comment.