Advertisement
Guest User

Untitled

a guest
Mar 1st, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. function shortcode_most_recent_post () { $args = array ( 'numberposts' => 30, ); $str = '<ul>'; $recent_posts = wp_get_recent_posts($args); foreach( $recent_posts as $recent ){ $str .= '<li><a href="' . get_permalink($recent["ID"]) . '">' . $recent["post_title"].'</a></li>'; } return $str; }add_shortcode ( 'most_recent_post' , 'shortcode_most_recent_post' );
  2.  
  3.  
  4. <?php $pages = get_pages( array( 'child_of' => 1 ) ); ?>
  5. <ul>
  6. <?php foreach ( $pages as $page ) : ?>
  7. <li>
  8. <?php echo get_the_post_thumbnail( $page->ID, 'thumbnail' ); ?>
  9. <h1><?php echo apply_filters( 'the_title', $page->post_title, $page->ID ); ?></h1>
  10. <?php echo apply_filters( 'the_content', $page->post_content ); ?>
  11. </li>
  12. <?php endforeach; ?>
  13. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement