On the form, change
action="<?php echo site_url("https://wordpress.stackexchange.com/"); ?>"
To:
action="<?php echo esc_url( get_post_type_archive_link( 'club_societies' ) ); ?>"
Where 'club_societies'
is the slug of the post type you’re searching.
That will set the form action to the archive URL, with the search parameters added, rather than the homepage with search parameters added.
Related Posts:
- Custom Post Type Archives by Year & Month?
- Get custom post type slug for an archive page
- Custom Post Type Settings page, choose page to display archive
- Adding a menu item for a Custom Post Archive
- Adding custom post type archives to a WordPress menu
- Custom Post Type Template – Archive
- How do you create an archive for a custom post type from a plugin?
- Custom Post Type Archives by Date with Custom Permalink
- How to List All Custom Post Types Names (Not Posts)
- Change title in head on Archive page
- What are the advantages of using a custom post type archive?
- Page is defaulting to archive page and not designated template
- custom post type archive page url to point to Page permalink
- Custom Post Type archive as front page
- Add Settings to Custom Post Type
- Custom Post Type Works but Still Shows “Page Not Found”
- I can’t set meta_key in my custom post type query
- Adding Sticky functionality to Custom Post Type Archives
- Adding custom post types to archive.php
- Archive page for taxonomy of custom post type
- archive-{$post_type}.php not loading. instead the default archive.php loads
- Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar
- How to make an archive page displaying posts in a date range
- Categories and Tags not working!
- Custom query variable – get wordpress to redirect to nice permalink url
- WordPress custom post type archive with description
- Display Next/Prev when looping Custom post-types archive?
- Add custom post type archives to search results?
- Archive page for custom post type not working
- Editable content on a Custom Archive page
- Second Custom Post Type Archive
- How do I get the permalink structure to work like this?
- An empty Custom Post Type Archive page returns 404 in WP 3.1
- is_main_query() not working for WP REST API
- WP_Query | ‘post_type’ doesn’t work
- Archives for Custom Post Types (without Pages)
- Set up Custom-Post-Type Author Archive
- get the custom post type title/name
- Custom post type templating problem
- Displaying Page as Custom Post type landing Page
- Single post with a Custom Post Type returns 404, when archives of the CPT work correctly
- CPT archive admin menu label
- Custom post type archive page blank
- Creating a Custom Post Type
- Custom Post Type slug same as page name
- Content Editable CPT Archive?
- Paginate_links in custom post type template
- Limit the Title Length on Custom Post Type Archive Page to a Set Number of Characters
- How to hyperlink content from archive page with custom post-type
- How to set up Custom Post Type archive page as Front page
- Custom Permalinks For CPT and pages with parent. Advanced WordPress
- How to integrate single and archive templates for custom post type in any WordPress theme
- ACF for custom post type archive pages: which hook to use?
- Show categories of custom post type and not all posts
- CPT Archive pre_get_posts not working?
- Removed custom post type archive page shows blog page
- Custom Post Type with Configurable Sidebar via ACF
- Plain links in single-class.php and archive-class.php not working
- Archive page for custom post type and custom taxonomy
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- Pagination does not work on Custom Post Type archive while trying to get load more function working
- CPT archive page – show one post from each taxonomy term
- Specifying a template for custom post type pages
- How to set a ‘page’ as parent of a custom post type?
- Archive page of CPT’s custom Taxonomy
- Archive page for WordPress Custom Post Type doesn’t show pagination from paginate_links()
- 2 Custom Post Types In 1 Archive Page?
- Different number posts per page based on custom post type term id
- How to change URL for custom post type archive?
- Displaying all posts by category and showing content on click
- Custom post type author issues
- ACF Pro Accessing fields on a Custom Post Type
- Do not show child pages within a file page
- Tell wordpress to show a single page instead of an archive page
- Custom taxonomy with custom post type archive page
- Custom post pagination not working
- Custom post type post_type_link gives “page not found” on any other custom post type
- Custome post type “tags” pick default archive instead of custom post type archive
- Highlight a Post on archive page if it has a new comment?
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- How do I make my archive page look like popular reviewing sites (e.g., Polygon and Gamespot) [closed]
- Rewriting archive page slug to be different than custom post type slug
- Site loads very slow for archive custom post type page
- Remove the “View” Link in Post edit Admin
- Have two (permalinks) urls for a same custom post type
- Archive page of filtered posts
- How to display the FAQ Archive page in my menu
- How can I set up the URL for a category archive for a custom post type?
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Archive Page Pagination not working
- single-mySlug.php works: archive-mySlug.php does not. Custom Post Type
- Create a Page Templete to Display Table Of Content for Custom Taxonomies
- has_archive for default post type
- Pagination for Custom Post Type with Multiple Types
- Custom Post Type Archive Title Lowercase
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Show custom post type on post category page doesn’t work / breaks navigation
- On archive.php show loop for child categories if they exist or posts if they don’t, on custom post type
- Dynamic WordPress rewrite rules for multiple custom post types
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query