You can use either GET or POST requests to achieve that functionality without using any AJAX (which, in fact, does the same but uses JS to process requests).
You need to add ?name_of_var=value after trailing slash on labels that link to different queries. Basically, your ‘Coca-Cola’ link has to look this way: site.com/products/?brand=cocacola
After that, let’s look into your queries’ code. Set your query variables beforehand, checking for needed ones in $_GET array. Here’s little example so you could understand what I am talking about:
$brand = ( isset($_GET['brand']) ) ? $_GET['brand'] : 'post'; // We do this because post type can't be defined as null in WordPress, change it according to your query arguments.
$query_args = array ( 'post_type' => array( $brand ) );
$your_custom_query = new WP_Query( $query_args );
Related Posts:
- Random sort within an already sorted query
- Exclude posts with empty post_content in wp_query
- Improving WP_Query for performance when random posts are ordered
- posts_per_page option limits the number of Gallery items
- Query for first 3 posts to change the look and feel
- How to give classname to post if post has no content?
- Show 5 posts and than 3 posts offset with pagination
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- Sort Posts Alphabetically Based on Specific Category (Divi)
- How to limit the number of posts that WP_Query gets?
- Should we trust the post globals?
- How to exclude latest x posts from a paginated query?
- How to know if get_posts() failed?
- Query posts distinct authors
- How to get previous 10 days post from a specific date – WP Query
- WordPress Number of Posts Not Changing With posts_per_page
- How to add posts to wp_query result?
- Exclude posts with specific meta_value while sorting by a separate meta_value
- Order post by year DESC and month ASC
- Should ‘setup_postdata()’ be reset with ‘wp_reset_postdata()’?
- Search query – exact post title match
- Hiding posts in a list from specified categories
- Sorting posts alphabetical that have single digits
- posts_per_page doesnt work
- Sorting posts according to view counts not working
- How would I get 1 latest post from a query for 5 posts?
- How to start with post number x?
- Only display a certain number of posts, dependent on how many posts there are available in a query
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Reset Popular post query?
- Get Posts that are in the current month or later
- Why WP_Query(‘showposts=5’) shows only 1 post?
- is there a way to show the the post title after the image?
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Random ajax load only works with posts_per_page set to -1
- Exclude the first ‘n’ number of posts of a tag from home page?
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- how can i change WP main archives loop to sort by name or title
- how to get post order by post id wp_query?
- Nested WP_Query breaking loop
- WordPress query_posts by tag doesn’t work anymore(?)
- Why Query is returning empty array?
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- meta_value timestamp older than now
- Counter is skipping post when I still want it visible [closed]
- Do not show children of a category
- why the same code got different results when using query_posts in functions.php and index.php
- How to get posts published on the latest date?
- Why posts array is empty?
- How to check in functions.php if there is data in a WP_Query?
- Shortcode with ‘year’ parameter
- On what hook can I get the queried object’s final state?
- wp_query with ajax
- WP_Query: Show 10 posts in date order, first three random
- Exclude some posts from displaying in wp_query based on some condition
- Random posts that always include a particular post?
- Related Posts function not working
- How to retrieve certain number of images from a wordpress post?
- WordPress post filter menu
- How to convert query sql to shortcode in wordpress?
- Query function not executed between element [closed]
- Echo the number of posts being displayed
- WordPress query portfolio posts
- Display 3 posts with different HTML markup using a loop
- Change content off every sixth element
- How Can I Always Display A Particular Post First Using WP_Query?
- WordPress Query – Display 5 posts (same post type), each from a given tag
- Show posts from two specific category in WP_Query
- WordPress sorting posts by date and title using a dropdown
- How to create loop of posts except post ID defined via ACF field
- Displaying all posts from other sites on the network on one site
- How to fetch courses in all languages in WordPress?
- How to sort WP_Post Object array by object field in php?
- Multisite how to display merged posts from two sites and sort by latest date?
- filter posts based on menu_order
- wp_query args with relation
- Ajaxify Post Sort
- Manipulate query to show specific post
- Querying posts from current category, using a variable as array argument
- Sort Events by Venue Title – Sort Post set by related post ids
- wp query custom orderby not custom field
- Query post category & remove any post id
- Advanced Post Display/Pagination/Ordering
- Ordering posts alphabetically by meta keys and title
- How do I control the fallback query after the original query returned cero posts?
- Remove duplicated posts in the loop if post has more than one category
- Adding a category at even positions on main loop with modified pagination
- Query Posts From Multiple Post Types
- Displaying Results From Custom Taxonomy Query
- WP_Query retrieve custom posts but not the post showing
- How to get alphabetic listing x other posts, based on first letter post?
- wp_query select if have comments
- Creating pages and getting their values from the database table
- How to limit post query to only return a total count of items with certain post statuses?
- custom sort posts in archive/taxanomy page
- Wp_query WooCommerce products
- query_posts different amount of posts per page [duplicate]