Bricks Builder Query Loop - Complete Guide with 7 Practical Examples
HTML-код
- Опубликовано: 16 окт 2023
- Update: In the Query loop of categories and sub categories, to the main Query loop you must assign 0 to the parent field.
In this tutorial I will solve the most frequent doubts about Query Loop in Bricks, you will learn how to use this tool with 7 practical exercises that you will use in most of your projects:
Query loop in Tabs
Query loop in Accordions
Query loop in with Sub categories
Query loop for Related posts/products
Query loop for Featured Products
Cross-Sell Query Loop
Up-sell Query Loop
Custom Query loop
This video will be a bit long but it will solve all your doubts.
👉Link for Custom Query. developer.wordpress.org/refer...
📣 Join the Facebook Community: / fancybricks
🤩 All Bricks templates: fancybricks.co/templates/
🔥 Buy Fancy Bricks: fancybricks.co/early/
Code for cross-sells:
$current_product_id = get_the_ID();
$crosssells = get_post_meta($current_product_id, '_crosssell_ids',true);
return [
'post_type' => 'product',
'posts_per_page' => 3,
'orderby' => 'menu_order title',
'order' => 'ASC',
'post__in' => $crosssells,
];
Thank you for this! This is exactly what I needed.
Great tutorial. Thank you for taking the time to create it. I’ll use your examples to try and create a product category archive page that list products in the sub categories.
Thank you so much! Working great! But, for upsells, it is showing the right type and amount of posts on the front but it displays ALL my products on the builder. Any idea?
You probably haven't set a product to preview in the template settings.
Thanks for the video! How would you do a query to display on sale woocommerce product that include variable products?
This is a post for Fancy Bricks premium users fancybricks.co/on-sale-products-query-loop/
@@FancyBricks nice, thanks!
linking the querys when you press onto the electric bolt iron, are you using ACF getting the information across with acf? or this all just bricks?
It's all native, but the explanation also applies if you use ACF fields.
Wooow very helpful thx. I would like to create a LINK TREE for my archive, and when you click on a category, the current tag should be displayed, but the tree structure, i.e. the link structure, should remain and not disappear. What's the best way to do this? I want to do it like you, with main categories and subcategories.
Do you mean something like this? fancyanimations.com/docs/install-the-plugin-and-activate-the-license/
@@FancyBricks
Yes, exactly, just with subcategories.
@@Manolito-rh8dt You must use the same template for the single post or archive in your case, this way you will give the impression that you are browsing through the tabs.
tab 1 build doing
first part where you you div as a title then 2ed part you use pane same as the div, would i be able use both as a div? would it be less complicated easier to remember ?
Hi, I don't understand your question, if you mean the quey in DIVs, adding a query loop requires a container.
@@FancyBricks can i choose div or block dose it make any differences? as i was going do both div as they both use the same query to each other
Container, block and div, return a div in the html. The difference is that the block and container are already configured with display flex and the container with a max-width. The div element has nothing configured. You can use whichever one suits you best.
@@FancyBricks thanks