Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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' );
- <?php $pages = get_pages( array( 'child_of' => 1 ) ); ?>
- <ul>
- <?php foreach ( $pages as $page ) : ?>
- <li>
- <?php echo get_the_post_thumbnail( $page->ID, 'thumbnail' ); ?>
- <h1><?php echo apply_filters( 'the_title', $page->post_title, $page->ID ); ?></h1>
- <?php echo apply_filters( 'the_content', $page->post_content ); ?>
- </li>
- <?php endforeach; ?>
- </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement