I think you need to first define property_com_listing_type
as a query:
Then you can rewrite the urls with add_rewrite_rule
(do not forget to save permalinks after change):
with a regex like ^category/([^/]+)/([^/]+)/?
Then you can modify the query using pre_get_posts
:
Related Posts:
- Can not switch the queried post in pre_get_posts hook
- When to use WP_query(), query_posts() and pre_get_posts
- Should I use Pre Get Posts or WP_Query
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- What is “main query”? [duplicate]
- Reduce or prevent calling of update_meta_cache
- How to add taxonomy filter on the query fly?
- Order Search Results Page by meta_value If no Value Return Remaining Results
- pre_get_posts with get_posts
- How-to exclude terms from the main query the most performant way?
- Slow SQL_CALC_FOUND_ROWS Query
- RSS feed with specific keyword
- Multiple orderby parameters in pre_get_posts() action
- Multiple endpoints in one URL
- SQL Statement generated by WP_Query not producing expected results
- Sorting Posts by custom field
- Query with pre_get_posts to get pagination
- Recommended way to drop a pending query (in pre_get_posts)?
- If orderby parameter using pre_get_posts is the same for multiple posts what fallback does the query use?
- How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?
- How to sort posts in admin by titles with dd.mm.yyyy format?
- Splitting the main query in multiple loops with query_posts and/or pre_get_posts?
- How to Modify Taxonomy Archive Page with Search Parameter?
- Searching through different categories on different pages code is not working
- How to display future posts – modified query still yields 404
- Difficulty with rewrite rules
- pre_get_posts filter meta_query without conflicting existing meta_query
- Including only current user’s posts in search
- My Main Query Modification is Messing up my dynamic main – why?
- pre_get_posts Remove tax_query Completely
- Single meta_query query using OR instead of AND in request’s WHERE statement
- How to choose between hooking into per_get_posts or into parse_query
- remove query arg from url after set query
- Store sticky post’s ids in a transient
- new WP_Query to get max price meta value not working
- WordPress add_rewrite_rule() cannot visit lower url levels
- Show Sticky Post at the top but do not show again in the loop?
- WP_Query, pre_get_posts and offset
- Using meta_query with multiple keys and compare values
- Can I set my WP_Query to be a Main Query?
- Remove category from query (show all posts in archive.php) pre_get_posts()
- Serve specific “template” page at any URL that ends in its slug
- Show scheduled posts in main loop but not in WP_Query?
- hide custom post types with specific meta key ON admin backend
- WP_Query ignoring tax_query when is_singular
- Applying posts_clauses filter to specific queries only
- Help ordering Post loop by two meta values
- Order ascending is ignored in meta query?
- New WP_Query calls Pre_get_posts filter twice
- Shouldn’t I be able to modify the main query by this filter?
- How Can I Change The Tax Query For The Main Loop For Taxonomy Archives?
- using pre_get_posts for search results not found
- Hide elements outside loop based on query
- pre_get_posts – Trying to get property of non-object warning
- How to use if($wp_query->query_vars[‘name’] == ‘pagethatdontexist’) without getting a 404? How to suppress 404
- queried_object using pre_get_posts gets notices and warning
- date_query in pre_get_posts out of memory
- Multiple meta_key ordering with pre_get_posts
- Sorting search results with custom dropdown
- pre_get_posts – editing query, tax_query
- Child pages not affected by orderby
- How to apply pre_get_posts to a custom query?
- $wp_query->found_posts not returning correct value
- WP_Query, Paginate by Custom Field
- `offset` WP_Query argument dont work via `pre_get_posts`
- Replace wp_query with wp_user_query
- Block internal search queries with pre_get_posts and regex rules
- WordPress rewrite with custom parameter doesn’t work
- is_user_logged_in not working from WP-API (wp-json)
- Search Exact on WordPress – Relevannsi Solution Not Working
- Excluding posts from search results page with meta query not working
- pre_get_posts pagination not working
- meta_query is overriding default search
- pre_user_query vs pre_get_posts
- Can I alter the main loop to ‘orderby’ a custom callback?
- order posts by a secondary query that counts items
- How to allow a variable with “/” in wordpress url
- Pre get posts sort by meta key returns no results if meta key does not exist
- Pre_get_posts only show posts by administrator roles
- Modify a query with no results in pre_get_posts
- How order by works?
- Order posts by title and custom field value?
- Custom Order Current Query: By Meta Key and Category
- Limit default Search query to post_title
- why doesn’t this pre_get_posts code work?
- pre_get_posts with WP_Query to prevent posts from specific tags
- Modify query to exclude certain ids and certain parents and its corresponding children
- Rewrite rule pagination on different url levels
- wp_query – Modify $query to include duplicate content
- Order posts by custom column using pre_get_posts
- pre_get_posts or $where, which one to use?
- Filter WP_Query output before it is accessed (pre_get_posts)?
- Sort posts in dashboard using custom field; also include posts where field isn’t set
- pre_get_posts redirecting
- Avoiding page loop
- Custom post types loop on a page template
- Pagination on custom post type not working
- Pre_get_post on CPT archive page
- Search query alteration not working for meta values
- How to put posts with some taxonomy on top of others in `pre_get_posts`