I am not quite sure I understand why do you need to hook into ‘bricks/query/run’. You can try and import the custom query setup that I have made on the testing enviroment (Use one of the options. For the first one save the code in a .json file and import it. For the second one just copy and paste the code in a blank Bricks page. After that fiddle around with the settings as you probably have different categories):
- This is a .json export of the template:
{
"id": 33,
"name": "testing-filters",
"title": "Testing Filters",
"date": "2024-12-09 14:34:43",
"date_formatted": "December 9, 2024",
"author": {
"name": "t76ae529",
"avatar": "https://secure.gravatar.com/avatar/cf417b19d3f706c4e5f8909a27a4e864?s=60&d=mm&r=g",
"url": ""
},
"permalink": "https://try.bricksbuilder.io/t76ae529/template/testing-filters/",
"thumbnail": null,
"bundles": [],
"tags": [],
"type": "section",
"content": [
{
"id": "2eb275",
"name": "section",
"parent": 0,
"children": ["354a33"],
"settings": { "_margin": { "bottom": "150", "top": "150" } }
},
{
"id": "354a33",
"name": "container",
"parent": "2eb275",
"children": ["b2ea7e", "aacb38"],
"settings": []
},
{
"id": "b2ea7e",
"name": "block",
"parent": "354a33",
"children": ["f060e6", "f14a7f"],
"settings": []
},
{
"id": "f060e6",
"name": "heading",
"parent": "b2ea7e",
"children": [],
"settings": {
"text": "Filters",
"tag": "h3",
"_margin": { "bottom": "20" }
}
},
{
"id": "f14a7f",
"name": "filter-checkbox",
"parent": "b2ea7e",
"children": [],
"settings": {
"filterQueryId": "81cacc",
"filterSource": "taxonomy",
"filterTaxonomy": "category"
}
},
{
"id": "aacb38",
"name": "block",
"parent": "354a33",
"children": ["c252de", "68a872", "e59ee5"],
"settings": { "_margin": { "bottom": "40", "top": "40" } }
},
{
"id": "c252de",
"name": "heading",
"parent": "aacb38",
"children": [],
"settings": {
"text": "Dummy Posts",
"tag": "h3",
"_margin": { "bottom": "20" }
}
},
{
"id": "68a872",
"name": "block",
"parent": "aacb38",
"children": ["81cacc"],
"settings": {
"_display": "grid",
"_gridGap": "30",
"_gridTemplateColumns": "repeat(2, 1fr)"
}
},
{
"id": "81cacc",
"name": "div",
"parent": "68a872",
"children": ["3c927b", "5f5661"],
"settings": {
"hasLoop": true,
"query": {
"post_type": ["post"],
"posts_per_page": "2",
"ajax_loader_animation": "ellipsis"
}
}
},
{
"id": "3c927b",
"name": "heading",
"parent": "81cacc",
"children": [],
"settings": {
"text": "{post_title}",
"tag": "h6",
"link": {
"type": "meta",
"useDynamicData": "{post_url}",
"newTab": true
},
"_margin": { "bottom": "5" }
}
},
{
"id": "5f5661",
"name": "text-basic",
"parent": "81cacc",
"children": [],
"settings": { "text": "{post_excerpt}" }
},
{
"id": "e59ee5",
"name": "pagination",
"parent": "aacb38",
"children": [],
"settings": {
"queryId": "81cacc",
"ajax": true,
"_margin": { "top": "30" },
"navigationTypographyActive": { "font-weight": "900" }
}
}
],
"templateType": "section"
}
- This is .json from the Copy/Paste function that Bricks has built in it:
{
"content": [
{
"id": "elddbf",
"name": "section",
"parent": 0,
"children": ["rkrymn"],
"settings": { "_margin": { "bottom": "150", "top": "150" } }
},
{
"id": "rkrymn",
"name": "container",
"parent": "elddbf",
"children": ["gpshcr", "fpmfsq"],
"settings": []
},
{
"id": "gpshcr",
"name": "block",
"parent": "rkrymn",
"children": ["xmpuug", "zcsuhm"],
"settings": []
},
{
"id": "xmpuug",
"name": "heading",
"parent": "gpshcr",
"children": [],
"settings": {
"text": "Filters",
"tag": "h3",
"_margin": { "bottom": "20" }
}
},
{
"id": "zcsuhm",
"name": "filter-checkbox",
"parent": "gpshcr",
"children": [],
"settings": {
"filterQueryId": "umkunn",
"filterSource": "taxonomy",
"filterTaxonomy": "category"
}
},
{
"id": "fpmfsq",
"name": "block",
"parent": "rkrymn",
"children": ["tjcxfe", "jzjcgv", "fuhjgg"],
"settings": { "_margin": { "bottom": "40", "top": "40" } }
},
{
"id": "tjcxfe",
"name": "heading",
"parent": "fpmfsq",
"children": [],
"settings": {
"text": "Dummy Posts",
"tag": "h3",
"_margin": { "bottom": "20" }
}
},
{
"id": "jzjcgv",
"name": "block",
"parent": "fpmfsq",
"children": ["umkunn"],
"settings": {
"_display": "grid",
"_gridGap": "30",
"_gridTemplateColumns": "repeat(2, 1fr)"
}
},
{
"id": "umkunn",
"name": "div",
"parent": "jzjcgv",
"children": ["uwuqvu", "zllsei"],
"settings": {
"hasLoop": true,
"query": {
"post_type": ["post"],
"posts_per_page": "2",
"ajax_loader_animation": "ellipsis"
}
}
},
{
"id": "uwuqvu",
"name": "heading",
"parent": "umkunn",
"children": [],
"settings": {
"text": "{post_title}",
"tag": "h6",
"link": {
"type": "meta",
"useDynamicData": "{post_url}",
"newTab": true
},
"_margin": { "bottom": "5" }
}
},
{
"id": "zllsei",
"name": "text-basic",
"parent": "umkunn",
"children": [],
"settings": { "text": "{post_excerpt}" }
},
{
"id": "fuhjgg",
"name": "pagination",
"parent": "fpmfsq",
"children": [],
"settings": {
"queryId": "umkunn",
"ajax": true,
"_margin": { "top": "30" },
"navigationTypographyActive": { "font-weight": "900" }
}
}
],
"source": "bricksCopiedElements",
"sourceUrl": "https://try.bricksbuilder.io/t76ae529",
"version": "1.11.1.1",
"globalClasses": [],
"globalElements": []
}