You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The file blocks.php can include calls to add/edit/remove blocks.
The file blocks.php is called when the user activate the theme
The Blocks are deleted before the theme is activated, because each theme can have differents blocks.
1.1 Structure of Blocks
key
title
value
description
1.2 Add / Edit / Remove a Block
<?php
# Add / Edit Block
$blocks->add(array(
'key'=>'test',
'title'=>'Testing Blocks',
'value'=>'Some HTML code or string value',
'description'=>'Description for the user'
));
# Delete Block
$blocks->delete('test');
?>
1.3 How to call a Block
<?php
# Get the title of the Block by the key 'test'
$title = $blocks->get('test')->title();
# Get the value of the Block by the key 'test'
$value = $blocks->get('test')->value();
?>
The text was updated successfully, but these errors were encountered:
I'm looking for implement some kind of settings for themes, so the developers of themes can include inputs from the users.
1. Blocks
One of the idea mention by @dimobelov and testing in Github code are called
Blocks
.blocks.php
in the root. Example, https://github.com/bludit/bludit/blob/master/bl-themes/alternative/blocks.phpblocks.php
can include calls to add/edit/remove blocks.blocks.php
is called when the user activate the theme1.1 Structure of Blocks
1.2 Add / Edit / Remove a Block
1.3 How to call a Block
The text was updated successfully, but these errors were encountered: