Skip to content

Snippet: Add New Blocks to the Staff Post Layout

The following snippet will show you how to add a custom block to your staff layout which you can enable in the Customizer, however, did you know you can build custom templates via the WordPress admin?

 * Example function for adding new "blocks" to the staff post layout manager.
 * After adding the code simply create a new file with the name "staff-single-YOUR_KEY.php"
 * and place this file at partials/staff/ in your child theme. Make sure to replace "YOUR_KEY" a unique keyname
 * that makes sense.
 * @link
add_filter( 'totaltheme/staff/single_blocks/choices', function( $blocks ) {
    $blocks['YOUR_KEY'] = 'Your Block Name';
    return $blocks;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top