Requirements
- WordPress: Version 5.9 or higher
- PHP: Version 7.0 or higher
Installation
To install the plugin, please refer to the “Installing a plugin” documentation.
Example
We invite you to minimize your window to reveal the following blocks.
This block is always visible.
This block is visible on screens larger than 1200px.
This block is visible on screens larger than 992px.
This block is visible on screens larger than 768px.
This block is visible on screens larger than 576px.
This block is visible on screens larger than 400px.
Personalization
Blocks
By default, settings are available on all blocks, but you can exclude blocks with the following PHP code in your theme’s functions.php
file:
add_filter( "habefast_gutenberg_visibility_get_excludes_blocks",function($array){
$exludesBlocks = ["core/heading"]; //array with excluded blocks name
return array_merge($exludesBlocks,$array);
},11);
Breakpoints
By default, the plugin adds the following breakpoints:
xxxxxxxxxx
["size"=>1200,"prefix"=>'xl'],
["size"=>992,"prefix"=>'lg'],
["size"=>768,"prefix"=>'md'],
["size"=>576,"prefix"=>'sm'],
["size"=>400,"prefix"=>'xs'],
Add a breakpoint
xxxxxxxxxx
add_filter("habefast_gutenberg_visibility_get_breakpoints",function($array){
return array_merge([
["size"=>1500,"prefix"=>"xxl"],
],$array);
},11);
Edit a breakpoint
xxxxxxxxxx
//As the prefix is already in use, its value will be replaced by
add_filter("habefast_gutenberg_visibility_get_breakpoints",function($array){
return array_merge([
["size"=>600,"prefix"=>"md"],
],$array);
},11);
Delete a breakpoint
xxxxxxxxxx
add_filter("habefast_gutenberg_visibility_get_breakpoints",function($array){
unset($array[1]);
return $array;
},11);