Snippets: Snippets: 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.
function my_staff_post_blocks( $blocks ) {
    $blocks['YOUR_KEY'] = 'Your Block Name';
    return $blocks;
add_filter( 'wpex_staff_single_blocks_choices', 'my_staff_post_blocks' );

Snippet Type: PHP

Posted Under: Staff

All PHP snippets should be added via a child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)