Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $excluded = array(1,35,37);
- $args = array(
- 'post_type' => 'attachment',
- 'numberposts' => '5',
- 'category__not_in' => $excluded
- );
- $images = get_posts($args);
- if (!empty($images)) {
- ?>
- <div class="wrap">
- <h5><span>Recently</span> Added</h5>
- <ul>
- <?php
- foreach ($images as $image) {
- $attachment_link = get_attachment_link( $image->ID );
- echo "<li><a href='".$attachment_link."'>".wp_get_attachment_image($image->ID)."</a></li>";
- }
- ?>
- </ul>
- </div>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement