The comment
get_post_type() is not a complicated function
led me to disable the Relevanssi plugin that I was using for search and determined that “Create custom search result snippets” setting had been selected and was causing issues with the post type being returned. Once I unchecked this, everything worked.
Related Posts:
- How do you get the count of posts in an archive page?
- AJAX search on post pages by custom post type
- How to make a WP_Query search with custom post types?
- Search multiple custom fields by using meta_query
- How Do I Use WP_Query to Run This Database Query as Search Result?
- 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
- Group search results by post type, but hide post types with no results
- How to create posts (not post template) to be displayed on projects page?
- WP_Query post at custom position
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- exclude custom post type by meta key in wp_query
- Query for posts in 2 taxonomies
- Search tags in CPTs
- How do I Use Nested Loops of Custom Post Types for MultiSite Blogs using WP_Query()
- Impossible to get Attachments Outside WordPress?
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Unable to get post content from custom post type loop
- Lists Posts from CPT that match the Title of the Page
- Help Structuring Query for Archive Pages
- Loop on front-page.php
- wp_query to find posts by year and month
- Remove duplicated values from a loop
- Custom Post Type Loop within Shortcode
- How to connect two custom post types with nested loops
- Query custom post type in the loop
- Including Custom Meta with posts_where query
- Very Slow Page – How to Optimize # of Queries?
- Display CPT posts based on specific taxonomy
- Show one item per category of a custom post type
- Custom loop with multiple taxonomy queries
- WP Query with categories only shows one post and ignores the category
- Problem: wp_query outputs all images on site
- Advanced search form with filters for custom taxonomies
- pagination not working for category.php (custom post types in categories)
- How can I group posts by months and years?
- Multiple Custom Post Type queries, how to DRY it up
- Using wp_query to modify the loop in index.php for a CPT
- Custom WP_Query doesn’t display all posts
- Query & the_content() is showing in the header
- Select2 AJAX and WP Query Returns ALL and does not filter
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Pagination not working on custom query on a page
- find custom post type post by searching its custom field with my string
- Trying to add a class to post links
- Display the current post in browser as the first post in a loop (for a slideshow)
- Display post from custom post type
- List all Custom Post Type posts excluding certain Taxnomy term
- Searching post types
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- How do I list a custom field and custom taxonomies for each result in a loop?
- Custom Post Type Query W/Category Dropdown
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Custom post type pagination error
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Page that lists publications by classifying them by taxonomy
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Exclude a specific post in a Custom Post Type
- Pin posts to top of custom loop
- Filtering posts based on three taxonomies
- Pagination Not Working When Used With WP_Query() `offset` Property
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- Search Function not searching correct custom_post_type even though post_type is defined in search args
- SEARCH QUERIES – REVERSE OUTPUT
- Error in the page of a CPT file in WordPress
- Live search by custom tag
- Staggering featured post using ‘sticky’
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- Mix Facebook and Twitter feed into custom posts
- sorting in wp query based on custom field value
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- Only show current category post
- Error in WP Query. If variable is empty it is displaying previous post value
- Strange behavior on WP_query
- How To Loop Through list with Custom Post Types
- WP_Query with custom post type search showing all results every time
- Is it possible to add query parameters on the archive page?
- Custom Post Type + Category archive
- display news with pictures 3 small and one large (loop)
- Post data in separate divs with incrementing class using WP_Query
- Custom post type blog pagination conflict
- next_posts_link returns same content of 1st page
- Custom loop won’t work, can’t find problem
- Custom post-type’s pagination not working in category.php
- Query Custom Post Type by Tag
- Customising wordpress search and using $_GET[“s”]
- How do I correctly query posts from a post ID?
- display custom post type from register taxonomy
- How to exclude certain portfolios from a loop
- Custom post type and have_posts() return empty result
- Searching Custom Posts content with JQuery
- WordPress search results grouped by post type
- How can I show posts with the same tag?
- How to insert a post from a different post type after every nth post
- Complex Custom Loop with Includes
- Group search results by post type, but having a unique heading for each section?
- Query Multiple Post Types and Paginate Newly Created List
- SOLVED: Shortcode to display Divi project filtered by tag in WP Query loop