bricks_set_responsive_settings
Overview
Overrides element settings at a specific responsive breakpoint. This tool handles the Bricks key:breakpoint convention automatically — you provide plain settings keys (without the breakpoint suffix), and the tool appends the correct suffix before saving. For example, providing _padding at breakpoint mobile_portrait results in the internal key _padding:mobile_portrait.
This is the targeted approach for responsive design — apply specific overrides to individual elements at specific breakpoints. For bulk responsive adjustments across an entire page, consider using bricks_auto_responsive instead.
Key Features
When to Use
To reduce font sizes for smaller screens
To reduce padding and margins on tablets and phones
To stack horizontal flex layouts vertically on narrow viewports
To hide decorative elements on mobile
To change element display mode at specific breakpoints
Element ID must be known (use bricks_get_page_content to find it)
Use bricks_get_breakpoints to verify available breakpoint keys
When NOT to Use
For bulk responsive adjustments across many elements — use bricks_auto_responsive
When inline responsive keys are already set during bricks_add_section (e.g., _padding:mobile_portrait in the element JSON)
Parameters
page_idnumberREQUIREDelement_idstringREQUIREDbreakpointstringREQUIREDtablet_landscape, tablet_portrait, mobile_landscape, mobile_portraitsettingsobjectREQUIREDcontent_areastringoptionalcontent Values: content, header, footerCode Examples
Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12
Collapse a 3-column grid on mobile
Override grid columns and reduce padding for tablet and mobile breakpoints on a feature grid element.
// Tablet: 2 columns, reduced padding
bricks_set_responsive_settings({
page_id: 42,
element_id: "abc123",
breakpoint: "tablet_portrait",
settings: {
_gridTemplateColumns: "1fr 1fr",
_padding: { top: "60", bottom: "60" }
}
})
// Mobile: single column, minimal padding
bricks_set_responsive_settings({
page_id: 42,
element_id: "abc123",
breakpoint: "mobile_portrait",
settings: {
_gridTemplateColumns: "1fr",
_padding: { top: "40", bottom: "40" },
_gap: "20"
}
})Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12
Stack flex row and reduce text on mobile
Change a horizontal flex layout to vertical stack and scale down heading typography on mobile.
// Stack flex items vertically on mobile
bricks_set_responsive_settings({
page_id: 42,
element_id: "def456",
breakpoint: "mobile_landscape",
settings: {
_direction: "column",
_alignItems: "flex-start"
}
})
// Scale down heading font size
bricks_set_responsive_settings({
page_id: 42,
element_id: "ghi789",
breakpoint: "mobile_portrait",
settings: {
_typography: { "font-size": "28px" }
}
})Common Mistakes
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1939
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1939
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1939
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Tips & Warnings
Common responsive overrides:
_gridTemplateColumns: "1fr"— single column on mobile_direction: "column"— stack flex items vertically_padding: { top: "40", bottom: "40" }— reduce padding 40-50%_display: "none"— hide decorative elements_typography: { "font-size": "28px" }— scale text down 30-40%
Inline alternative: You can also set responsive overrides directly in bricks_add_section JSON using the key:breakpoint convention, which avoids needing a separate API call.