What you describe is the typical use case for a custom post type. When you register your post type, set the has_archive
argument to true
and WordPress will generate a custom post type archive page, which will be the list of all your property posts.
Normally, the number of property posts displayed will use your admin setting for Blog pages show at most
, located under Settings > Reading
, but you can override that to display all, no matter the number, via the pre_get_posts
action:
function property_posts_per_page( $query ) {
if ( is_admin() || ! $query->is_main_query() )
return;
if ( $query->is_post_type_archive( 'property' ) ) {
$query->set( 'posts_per_page', -1 );
}
}
add_action( 'pre_get_posts', 'property_posts_per_page' );
Related Posts:
- WP_Query() show posts that end later than today
- How to hide CPT files from media library programmatically
- post count is wrong when using same taxonomy for 2 different CPT
- Custom post types – RSS lastBuildDate issue
- Determine which template-{slug}.php is being loaded
- How to remove/hide elements from the admin menu?
- Show Custom Post Type by Author
- Newer/Older posts links display same posts on every page
- How to sort CPT by custom meta value (date), and return posts month by month
- Archive page for taxonomy of custom post type
- Search results ordered by custom post types are not grouped
- CPT tax slug conflict with post type slug
- $wpdb returns no results with SELECT query on custom post type, works on default post type
- When viewing single parent post, display list of children
- Featured image metabox not showing up
- Exclude current post when getting related post on custom post type and taxonomy
- How to redirect all pages of a custom post type [duplicate]
- Upload Image from Front End and Resize
- Multisite with a single, shared custom post type, while retaining site URL
- custom post type default permalink
- Show custom field from custom taxanomy term on custom post type
- How do I sort a custom post type admin column using two meta keys?
- Allow Administrator role access to custom capabilities [duplicate]
- Taxonomy.php Not Showing Posts
- Custom search results page query, link permalink to post title while separating by post types
- Plugin translation not working apart from name and description
- Creating Multiple Loops in Genesis, One Post then 20, each with custom fields
- custom comments on specific post type
- wp_insert_post generates endless posts
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Allow user to set custom order to a list of custom taxonomies?
- Crafting WP_Query array, sort by date
- Disable block with taxonomies at post page
- WordPress wrapped added a span tag to every single p tag
- Custom Post Types with a common category for a blog listing
- Custom Widget WP_Query problem
- Custom Fields for Custom Post [closed]
- Removed custom post type slug but not working for child pages
- Terms showing up in object cache on unrelated pages
- Show Custom Post Type meta boxes only on Page Edit
- Creating a Page Template to display all items from a Custom Post Type
- using wp_update_post for updating custom post type
- 2 Different Custom Post Types in Submenu
- How to assign classes to all elements?
- Search filter triggered & sort by custom post type
- How can meta boxes be added to “unknown” custom posts?
- Custom “radio button meta box” not saving correctly
- link to a random custom post while excluding current post
- Custon Content within WordPress Loop
- Custom Taxonomy Category link
- HowTo: Custom Post Type (Meta) to Custom Table
- How to group navigation items in the admin panel
- Create Array from custom post type to display a slider
- Values from meta-box not on $_POST
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- How to set the mainpage of a custom post type?
- Displaying a list of Contacts
- Questions regarding add_meta_box()
- Loop Post Types with Name and Links
- Setting a homepage – doesn’t seem to work
- Display all images from specific CPT
- How to Control CSS Class Visiblity From WordPress Admin Panel based on Tax Terms
- Problem retrieving informations and displaying desired structure with custom post type and taxonomy
- Galleries of images attached to posts
- Last post in loop – custom post types
- Add Tags to a Custom Post Type from a FrontEnd Form
- Archive page of CPT’s custom Taxonomy
- wp_query can’t get max_num_pages in custom post type
- WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
- Can I automatically assign a page template to a custom post type (i.e page-slug.php file)
- How to show related posts of category on post within custom posttype
- Saving custom JSON as custom post type
- Preview url not working outside wp-admin
- Post Tags not working for Custom Post type
- Restrict Custom Post Type to One Item
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- Custom URL for Custom Post Type & Custom Taxonomy Term
- Remove wp directory and slug for custom post type from the URLs
- Using pre_get_posts assign custom post to wordpress editor user
- Edit single page from plugin
- Manually build WP_Query
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Custom Post Type used for FAQs Accordion
- Custom Post Type vs Shortcode: Which one is more performant?
- Custom Post Type Causing Admin Sidebar UI Issue
- WordPress Custom Post Type and sort by Tags
- Show list of categories in post editor only from current custom post type
- Classic Custom Post Types and WP-PageNavi
- Can I set a CPT title field to a dropdown with preset options if user is of a given type?
- List of filtered Events is breaking paging?
- Permalink of Custom Post Type
- single-mySlug.php works: archive-mySlug.php does not. Custom Post Type
- How can i manually relate pages?
- has_archive for default post type
- No error in debug mode, wordpress template can not be loaded
- Pagination for Custom Post Type with Multiple Types
- Custom Post Type Archive Title Lowercase
- Multiple posts selection [closed]
- How to make a non-public post on wordpress approval?
- Quering array of post types & pagination. Articles are repeating sometimes on different pages