/**
* Example function for adding new "blocks" to the portfolio post layout manager.
*
* IMPORTANT: The module will be disabled by default, be sure to go to the Customizer
* to enable it.
*
*/
add_filter( 'wpex_portfolio_single_blocks', function( $blocks, $instance ) {
// Used for customizer setting to drag/drop the new module
if ( 'customizer' == $instance ) {
$blocks['tags'] = __( 'Tags', 'wpex' );
}
// Used for the front-end output
// Here you can define an anonymous function for the output or set the value to a function name used for the output.
else {
$blocks = array_combine( $blocks, $blocks );
// Add custom output for the tags
if ( isset( $blocks['tags'] ) ) {
$blocks['tags'] = function() {
// Get tags
$taxonomy = 'portfolio_tag';
$show_links = true;
$echo = false;
$tags = wpex_list_post_terms( $taxonomy, $show_links, $echo );
// Output tags
if ( $tags ) {
echo '<div class="my-portfolio-tags clr">' . $tags . '</div>';
}
};
}
}
// Return blocks
return $blocks;
}, 10, 2 );
Snippets: Add New “Blocks” To The Portfolio Post Layout
Result:

All PHP snippets should be added via a child theme's functions.php file.