• I’m trying to create an archive for the built-in attachment post type. I’d like to display the (let’s say) 50 images most recently uploaded to the site, with a link to the next 50, and so on. Can it be done?

Viewing 1 replies (of 1 total)
  • Just create new page template with this code –

    <?php
    	$attachments = array(
    		'post_type' => 'attachment',
    		'post_status' => array('publish', 'draft', 'inherit'),
    		'numberposts' => -1,
    		'posts_per_page' => 10,
    		'paged' => $paged,
    	);
    	query_posts($attachments);
    
    	if (have_posts()) : while (have_posts()) : the_post();
    ?>
    
    CODE TO DISPLAY YOUR ATTACHMENT
    
    <?php endwhile; else: ?>
    
    NO ATTACHMENTS
    
    <?php endif; ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Paginated attachment archive’ is closed to new replies.