Custom row template, again
-
Hello.
I have read the other posts on this topic thoroughly but i cannot get my head around what i need where, sorry to ask again but i am really, really stuck:
I have this in my functions.php:
function my_block_editor_assets() { wp_enqueue_script( 'my-block-editor-js', get_stylesheet_directory_uri() . './block-editor/block-filter.js', array( 'wp-hooks' ), '1.0.0', true // Enqueue the script in the footer. ); } add_action( 'enqueue_block_editor_assets', 'my_block_editor_assets' );
The file ‘block-filter.js’ resides in ‘themename/block-editor/block-filter.js’ (so the folder ‘block-editor’ and my functions.php are on the same level).
The content of this file is:
function myRowTemplates(templates) { templates.push( { name: '1-1-1-1', title: '4 Columns', icon: 'layout', templateLock: 'all', template: [ [ 'wp-bootstrap-blocks/column', { sizeLg: 3, sizeMd: 6 } ], [ 'wp-bootstrap-blocks/column', { sizeLg: 3, sizeMd: 6 } ], [ 'wp-bootstrap-blocks/column', { sizeLg: 3, sizeMd: 6 } ], [ 'wp-bootstrap-blocks/column', { sizeLg: 3, sizeMd: 6 } ] ] }); return templates; } wp.hooks.addFilter('wpBootstrapBlocks.row.templates', 'themename/wp-bootstrap-blocks/row/templates', myRowTemplates);
Do i need anything else?
Somehow it seems i also need a file in ‘themename/wp-bootstrap-blocks/row/template’ so i tried to copy the file from the extension into that place, so in there i have the file ‘row.php’ with its original content.I am completely stuck, like sitting in front of a wall i’d like to look through but can not.
Any help is definitely welcome and appreciated.
Will try to get along but please, if you have an idea what i’m missing, please tell me ??Thank you so much, cheers, Frank
- The topic ‘Custom row template, again’ is closed to new replies.