Snippets: Snippets: Add New “Blocks” To The Staff Post Layout

 * Example function for adding new "blocks" to the staff post layout manager.
 * After adding your new blocks 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" with
 * the key given in the array. So as an example for the function below you will create a file
 * called single-custom-fields.php for your custom code
 * IMPORTANT: This module will be disabled by default, so you will have to go to the Customizer to enable it.
function my_staff_post_blocks( $blocks ) {

    // Add new block "categories"
    $blocks['custom-fields'] = __( 'Custom Fields', 'wpex' );

    // Return blocks
    return $blocks;

add_filter( 'wpex_staff_single_blocks', '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)