You should use add_feed()
function (take name of feed and callback) to add new feed, it will take care of settings up hooks and rewrite rules automagically.
Then in your callback function you can use query_posts()
to override query before loading template.
Related Posts:
- Add Taxonomy Values Within a Custom Post Type RSS Feed
- Display custom fields from custom posts in RSS feed
- How to fetch custom post types with its full data on wordpress?
- Multiple orderby values in WP_Query
- Add Custom Fields to Custom Post Type RSS
- How to Make a Separate RSS Feed for Each Custom Post Type
- Search multiple custom fields by using meta_query
- WP_Query orderby custom field then post_date in one query
- how to filter by last name for custom post
- Filtering a WP_Query meta_query by numeric values isn’t working
- Filtering a WP Query result
- Display Custom Post Type Fields
- Search Custom Post Type with all meta attached?
- Custom post types – RSS lastBuildDate issue
- How to sort CPT by custom meta value (date), and return posts month by month
- How to remove CPT comment feed from head?
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- WordPress query by multiple Custom fields and order by date
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- WP Query group/order by category name
- Sort by two dates. Default entry date and custom field if present
- Filtering by Post Meta Custom Fields – Performance
- wp_query to find posts by year and month
- WP Query—Relationship between two custom post types and their fields
- How to dynamically attach pictures to a carousel
- Custom Post type and Custom Field WP_Query
- Including Custom Meta with posts_where query
- Publish an XML feed from a CPT with ACF fields?
- Include only recents custom posts in WP rss feed
- WP_Query: include custom post type only with specific meta value
- Custom taxonomy in custom post RSS feed
- WordPress custom loop filter by meta_key and value with serialize data
- Returning a list of custom post types excluding those without a specific meta_value
- wp_query check if integer exists in custom field’s array
- How can I get the number of custom post type posts that have a specific attachment image set?
- Problem querying Custom post type by custom fields
- Orderby CPT custom fields not working
- WP_Query order by custom field, then randomly order some of results
- Query custom post type with ACF Date
- Including metaboxes from custom post types in global search — continued
- Query Multiple Custom Posts by Custom Fields
- Get Posts by multiple custom fields is not working
- Order Custom Post Type by Custom Field Value
- First custom field value (out of several) displayed twice after query
- Possible to filter custom post type with multiple meta data?
- WP Query ‘posts_per_page’
- post_per_page ignored in WP_Query
- How to get specific post meta by title or id
- Creating separate feeds for custom post types
- WP_Query orderby not work with meta_key
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Display custom post type for specific user
- Group by custom field value (start and end times)
- Cache issue with WP_Query and custom field filtering
- How do I list a custom field and custom taxonomies for each result in a loop?
- WP query_posts group by meta field related
- Disable permalinks, but allow RSS feeds
- WP Query from two Custom Post type fields as statement
- Alike Shortcode using in Custom Shortcode
- Query custom post type that has a serialized relational advanced custom field value
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- WP_Query get always custom post_type for first
- Sort custom post column by generated value?
- How can I query and sort custom-post type using WP_Query
- Filter posts by their related field’s custom field
- Query custom post type and custom field by URL parameters
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Query a Custom Post Type using SELECT that has ACF fields to compare dates
- meta query multiple values for the same key
- Sort custom post archives by a meta value from a different custom post type?
- Custom post types – meta_query: search lesson which starts sooner
- Post Filtered by Custom Field Value
- Filter custom WP_Query by first letter of a custom field – hopefully using Search and Filter Pro?
- sorting in wp query based on custom field value
- Meta_Query refuses to return results
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- WordPress feed only shows first page of category
- Error in WP Query. If variable is empty it is displaying previous post value
- Query events post type after current date and timezone
- How to stop wp_query searching pages as well as the specified CPT
- Selecting posts older than the current Unix epoch timestamp
- WP_Query and two custom fields returns no posts
- WP_Query get posts where post_name is empty
- Storing/querying custom date data
- Query recent posts by author
- Querying meta values within an array
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- Filter Custom post type by another Custom post type
- Show Posts in Vertical Tabs with Scrollbar
- Changing the RSS feed titles not working
- How to show all posts of specific custom post type with their custom fields values?
- querying to custom field over ACF REST API
- Display ACF object field data using Elementor Custom Query
- WordPress custom field sorting, weird behavior: the latest post is at the end
- Sort CPT by taxonomy AND THEN by custom field
- Query order by a numeric ACF field