Since you’re searching on the user end (as far as I can see), you will only be able to find data that has been sent to the user. So, if you archive page does not include the full post, you won’t be able to search that.
The obvious solution is that you’ll need to send all post content over. There are two possible approaches:
-
From within the script, retrieve the posts using the rest-api. This means you won’t have to change the archive page as it is. It might affect performance, though, as you may be issuing a lot of data request to your server which may also be hold up during transfer to the user end
-
Change the archive page so it includes the complete posts and use some css to hide the full content as long as it is not needed. Probably the best approach.
Related Posts:
- 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
- Search Custom Post Type with all meta attached?
- How Do I Use WP_Query to Run This Database Query as Search Result?
- Search tags in CPTs
- Including Custom Meta with posts_where query
- Including metaboxes from custom post types in global search — continued
- Advanced search form with filters for custom taxonomies
- Custom filter for main search: how to exclude specific post_type from search results
- how to get this tax_query working?
- Select2 AJAX and WP Query Returns ALL and does not filter
- find custom post type post by searching its custom field with my string
- Searching post types
- Change search query in wordpress custom post type
- Search Function not searching correct custom_post_type even though post_type is defined in search args
- post_type incorrect for custom post type
- Live search by custom tag
- Create Second Search Page Only for Custom Post Type
- Conditional posts in WP_query for search
- Manually build WP_Query
- WP_Query with custom post type search showing all results every time
- Custom post type blog pagination conflict
- Customising wordpress search and using $_GET[“s”]
- Why does ‘exclude_from_search’ exclude a custom post type from WP_Query?
- Custom post archive with search, is_search() is false?
- How to order separated Custom Post Search results
- Wp_query: sort by PHP variable
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Custom-Posttype & Custom Taxonomy WP_Query
- Crafting WP_Query array, sort by date
- Custom loop with multiple taxonomy queries
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Converting the_content string to an array?
- search also in taxonomy, tags and custom fields
- forming WP_Query for posts of all post types but from specific categories
- Custom post type search using $_SESSION and pre_get_posts
- Get latest 3 posts from multiple CPT in one query
- How to stick custom post at the top in search results
- Loop to fetch 3 post_thumbnail instances from 3 most recent custom post types named “portfolio”
- filter custom post type by meta key in dashboard
- Display upcoming Events for next 7 Days
- Can I search only some of the fields of a custom post type?
- Custom Post Type And “fopen”
- Filter custom posts using auto populated dropdown selectors
- Isotope Filtering with Bootstrap Tabs – Custom Post Type Query Loop in each Tab (Have to click twice to filter)
- Custom post ui plugin & WP_Query – Polylang
- Make parts of your wordpress website completely built with data from external APIs?
- How can I get the number of custom post type posts that have a specific attachment image set?
- How to use load more custom post type data normal or according to on click category tab In WP
- orderby rand is not working for a custom post types
- WordPress sort search results by custom order
- Problem querying Custom post type by custom fields
- Orderby CPT custom fields not working
- Custom taxonomy rewrite give pagination 404
- WP_Query order by custom field, then randomly order some of results
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Mixing 2 custom post types with posts output in specific pattern
- Custom post taxonomies as tax_query terms?
- creat filter with wp_query
- Troubles with acf/save_post and WP_Query
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- Query custom post type with ACF Date
- How to do WP_Query with two meta fields with orderby clause
- Stuck in Order by more then one
- Display featured image from one CPT within another CPT query
- Custom WP Query on custom meta and sort by multiple meta keys value
- Show only one post on custom post type archive
- Woocommerce search pagination not working
- How to order WP_Query by parent for hierarchical Custom Post Type?
- Custom post type not showing in search result
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- How can I made custom taxonomies relationship?
- Query Multiple Custom Posts by Custom Fields
- What’s the WP way to load remaining custom posts?
- Why is this query not working? (Standard posts + custom post type)
- How do you paginate a query grouped by month?
- Custom taxonomies relationship
- Get Posts by multiple custom fields is not working
- Custom post type ‘articles’ ignores posts_per_page, reserved post_type?
- Several post types on WP Query by tag and taxonomy
- WP Query with categories only shows one post and ignores the category
- What to and how to proceed with CPT to make DB small and efficient?
- Polylang non-default language ignores tags in WP_Query
- WordPress request fiter order by related post’s post_title
- Pretty URL for custom search for custom post type
- Custom Widget WP_Query problem
- Custom query at top of archive search page, arguments are overridden
- Order Custom Post Type by Custom Field Value
- Add post location with mile radius allowing search
- WP_Query custom post type query not showing the exact post type
- Include custom post type content in search
- How to display post list inside post
- Pagination issue on category.php using custom post type query
- Get post count for search result based on post type
- How to have this permalink structure: post_type/postname/custom_inner_page
- Problem: wp_query outputs all images on site
- Query Custom Post Type Taxonomy term with multiple parameters
- Auto Complete Search
- search suggest – filter post type