PHP code example of nolte / lean-styleguide
1. Go to this page and download the library: Download nolte/lean-styleguide library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nolte / lean-styleguide example snippets
add_filter(
'lean_styleguide_component_variables',
function() {
return [
'placeholder-key' => 'placeholder-value',
'placeholder-key-2' => 'placeholder-value-2',
];
}
);
add_filter(
'lean_styleguide_component_variables',
function() {
return [
'image-id' => 2 // Where 2 is the WP image attachment ID.
];
}
);
add_filter(
'lean_styleguide_template',
function() {
return get_stylesheet_directory() . '/styleguide-template2.php';
}
);
add_action(
'lean_styleguide_header',
function() {
echo '<style>
body {
background-color: blue;
}
</style>';
}
);
add_action(
'lean_styleguide_footer',
function() {
echo '<script>
console.log(\'hello\')
</script>';
}
);
add_action(
'lean_styleguide_component_dir_path',
function() {
return get_template_directory() . '/frontend/views';
}
);
add_filter(
'lean_styleguide_css',
function() {
return get_stylesheet_directory() . '/frontend/dist/main2.css';
}
);