You can hook into pre_get_posts
and modify the query. Your hooked function will receive a WP_Query object as it’s only argument. You can check to see if you’re on a the correct post type archive and modify away.
Something like this:
<?php
add_action('pre_get_posts', 'wpse63675_pre_posts');
function wpse63675_pre_posts($q)
{
if(!is_post_type_archive('your_album_type'))
return;
$q->set('posts_per_page', 20); // or however many you want
}
You can drop the above in your functions.php
file or a plugin. Use with caution.
I wrote a plugin that takes care of this for you. It does the above, but with a set of fields in the admin area.
Related Posts:
- Custom Post Type Settings page, choose page to display archive
- How to get the custom post type from an archive page?
- Loading custom page template via plugin
- Pagination problems with multiple custom post type archive pages
- Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy
- WordPress custom post type archive with description
- CPT: archive-cpt.php VS custom page template
- Custom post type and taxonomy permalinks – Structure
- Navigation menus not showing because of custom post type filter
- Rewrite URL for only archive page (custom post type)
- Archive slider for CPT
- How To Create A Custom Taxonomy 404 Page
- Archive template for custom post type only lists first 10
- Change archive page template using pre_get_post
- Custom post type is showing custom home page, not archive page
- Isotope Filtering with Bootstrap Tabs – Custom Post Type Query Loop in each Tab (Have to click twice to filter)
- Why is my site using index.php instead of archive?
- Custom post type archive page blank
- My archive-posttype.php template is not loading
- Custom Post Archive is not working
- Which Template Page Should I Use?
- Display custom post types in wp_list_pages
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- How to integrate single and archive templates for custom post type in any WordPress theme
- Custom post type permalink uses archive page to display posts
- Taxonomy template page not working
- CPT with its own category and tag url
- Custom Post Type Archive template not being called
- Can’t replace the default sidebar with a custom sidebar on Custom Post Type in Genesis
- Best way for a plugin to define a custom post type archive template?
- Is possible register two archive pages for single custom post type?
- Archive page of CPT’s custom Taxonomy
- Pagination links for custom post type shows correct number of links, but links result in Page not found
- Finding the CPT archive template source
- ACF Pro Accessing fields on a Custom Post Type
- Multiple Custom Post Type in Taxonomy Archive Causing White Screen
- get first limited words from a custom post in the archive page
- Iterating over custom post type archive returns incorrect first ID
- Show index and not the archive for “Dog Custom Post” with default slug
- Custom post type archive page not showing on archive-posttype.php
- Custom post type with two templates
- How do I make my archive page look like popular reviewing sites (e.g., Polygon and Gamespot) [closed]
- Display custom post type archive on page.php template
- Multiple archives for cpt, taxonomies, terms
- Making a archive gallery page for a custom post type which already has an archive page
- Get Non-Paginated Index of Post in Paginated Query
- How to assign custom post template to its custom taxonomy terms
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Archive templates based on taxonomies
- Organizing Custom Post Type Archive Template
- listing custom post type category page
- Two different archive pages showing the same content
- Archive custom template from search
- how to pass args for archive.php query?
- Pagination not working only on Archive-Name.php using new WP_Query
- How to make posts under custom post type not generate a URL / post
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query
- how can i call archive-{post type}.php template from my custom plugins to my theams?
- How do test if a post is a custom post type?
- Where to put my code: plugin or functions.php?
- What does this PHP function code mean? [closed]
- Remove slug from custom post type post URLs
- How to disable the single view for a custom post type?
- Custom post types, taxonomies, and permalinks
- Query all posts where a meta key does not exist
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- How to get all taxonomies of a post type?
- How to sort the admin area of a WordPress custom post type by a custom field
- How to create a custom search for custom post type?
- Deregister custom post types
- Can I assign a template to a custom post type?
- Permalinks: custom post type -> custom taxonomy -> post
- Should I use custom post types or a custom database tables for plugin development?
- Enable revisions for custom post type
- Extending the search context in the admin list post screen
- How do I query a custom post type with a custom taxonomy?
- Adding a Custom Post Type into the menu screen
- Pagination not working with custom loop
- How to Add Tags to Custom Post Type?
- How come Featured Image isn’t showing up in my Custom Post Type?
- Custom Post Type URL Rewriting?
- Add category base to url in custom post type/taxonomy
- Include custom taxonomy term in search
- Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu
- Adding ‘menu order’ column to custom post type admin screen
- Capabilities and Custom Post Types
- Can the Next/Prev Post links be ordered by menu order or by a meta key?
- what is the correct way to compare dates in a WP query_posts meta_query
- Use register_post_type() to modify an existing post type
- Custom Taxonomy specific to a Custom Post type
- Renaming Custom Post Types and Taxonomies
- List all posts in custom post type by taxonomy
- Redeclare/Change Slug of a Plugin’s Custom Post Type
- Allow member to have access to custom post type only. Permission to only edit their own posts
- Mixing custom post type and taxonomy rewrite structures?
- Advanced search form with filters for custom taxonomies and custom fields
- Highlighting wp_nav_menu() Ancestor Class w/o Children in Nav Structure?
- Resolve a custom post type name vs. page permalink conflict (same slug)
- Get custom post_type’s archive URL
- Enable Gutenberg on custom post type