There are multiple ways of doing this.
-
Use a session.
Set a session and update your session value each time the filter has changed by the user.
Check out PHP sessions. -
Use a cookie.
Set a cookie and update your cookie value each time the filter has changed by the user.
Check out PHP setcookie. -
Update user_meta (if users are registered users).
When your users are registered users, you can set and update auser_meta
value each time the user changes the filter.
Check out add_user_meta and update_user_meta.
Related Posts:
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- How can I show 1 featured post in a styled element, and the next few below differently styled
- Create new custom post and post category of same name
- How to show all posts of the category in wordpress?
- Get category id from post id of a custom post type
- Load custom posts with same tag as page
- Remove date and category filters when editing custom post types
- Filter get_categories() for taxonomy term in WordPress
- How to show related posts by category or custom post type?
- Structuring a product catalogue in WordPress [closed]
- Categories and Tags not working!
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Search doesn’t find tags or categories in custom post types
- Filter categories of posts with checkboxes
- How to get the post type from a category id?
- How to detect filter in URL in Category page?
- Group posts by custom post type
- Getting posts under the custom post type ui category
- Show custom post type filtered by category
- Showing posts from different categories and from custom post type
- Custom post type getting wrong categories and tags
- Categories of custom taxonomy don’t show any posts
- Add custom post type settings to wordress default posts
- Problem with displaying posts in the CPT category
- How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
- How to change the post type a theme shows by default?
- Set a checkmark in a category based on a URL-parameter
- Get the category from custom post type
- Custom Post Slug same as Parents Category Slug
- Loop filtering Custom Post Types and/or Categories
- Cross reference custom post types
- How to get all tags of a custom post type by id
- Categories filtering in new post
- Redirect to another page using contact form 7? [closed]
- WP the_posts() on single-cars.php get category link
- Tag page only display 10 posts
- wordpress remove views from action links in a custom post
- wp_insert_post wrong post type [closed]
- Custom post types and ‘new WP_Query’
- Meta data (Tags and Categories) for Custom Posts not showing.
- How to Display Posts From Category Within a Custom Taxonomy?
- Showing custom post type categories in the menu
- Why does my taxonomy have a category style div id?
- Need help deciding on a taxonomy
- Stores category posts in an array
- Get Posts by Category, Tag , and CPT Taxonomy
- The Difference Between Categories and Tags and Taxonomies and Terms
- Restrict category access to specific users/groups. Author always has access
- Post Query not working
- How to filter url on post submission?
- Use post in multiple places on a page with multiple posts
- Custom post type tags not showing in search
- Am I mixing up the concept of posts pages and categories?
- Custom post type, taxonomy and admin bar
- Advanced archive url structure (category, tag and date)
- Display custom post front end filter by ACF equals current user
- Display all Categories except ones with a specific parent
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Best way to fix bad count on All | Mine | Published
- Search CPT by tag ids
- Post category behave like a Post in back office menu
- Save data is post using php front end
- get taxonomies from terms
- how to display posts content on the custom css popup by clicking on each title on the sidebar?
- How to set “section categories”?
- How to show posts of the same category on a page?
- How to manage a dynamic multi-level page hierearchy system?
- Custom Post By Category
- show only one category and filter by tag
- Change Custom Post Type to Post + Category
- Rewrite url post_tag for custom post type
- Only show current category post
- Do not output category and tag URLs
- Adding Information To All Posts Screen
- Dropdown switching subcategories portfolio
- Filter wp_dropdown_categories Per Post Type
- Organizing The Custom Post Type with Taxonomies / Parent Posts
- Filter custom post type by tags
- Post Editor: display categories from current post type taxonomy only?
- Custom Post Type – Admin Columns
- Custom Post Type used for FAQs Accordion
- Hook only specific post type
- Display all post types together
- How to filter posts by categories?
- Post type cloud like tag cloud?
- show only one category posts in admin
- Get the ID of the latest post
- Change permalinks for posts but not for custom post types
- Front end post editing using a form
- Get categories for a specific post – Custom post type
- Categories not working as expected with custom post type
- associate custom post type with tags with specific pages
- How to show CPTs in term archive
- Post image in WordPress not appearing on home page
- Query within a foreach within a query (queryception)
- How to implement a different permalink structure for custom post type?
- Custom Post Type Custom Archive Page Not Working
- How to Show all Values in category.php page using post_type
- Having some trouble properly displaying Custom Post Types in templates
- Using predefined html in new posts