Gutenberg Block Template for Page Template or Category
-
I’ve read the documentation for defining block templates and locking the layout by post type (i.e. by post, page, or custom-post), but is it possible to define the layout by post_meta data like page template or post category?
function myplugin_register_template() {
$post_type_object = get_post_type_object( ‘post’ );
$post_type_object->template = array(
array( ‘core/paragraph’, array(
‘placeholder’ => ‘Add Description…’,
) ),
);
$post_type_object->template_lock = ‘all’;
}
add_action( ‘init’, ‘myplugin_register_template’ ); -
Hi there,
The site qualityaspirators.com appears to be a self-hosted WordPress (also called “.org”) site hosted on SiteGround Web Hosting, and not a site hosted on our WordPress.com service.
You can confirm here: https://gwhois.org/qualityaspirators.com+dns
To clarify, we are not the only providers of WordPress sites, and SiteGround also happens to offer WordPress sites, but they use a different version of the platform than what we use here. Because of this we are not able to help with your issue as it lies outside of our system. See http://support.wordpress.com/com-vs-org/ for more info.
You can find support for your advanced WordPress question here: https://wordpress.org/support/forum/wp-advanced/
Hope that points you in the right direction!
- The topic ‘Gutenberg Block Template for Page Template or Category’ is closed to new replies.