custom post template design with dropdown option

custom post template design with dropdown optionHi problem is after I design a post with GUTENBERG how can I save this

custom post template design with dropdown option Hi problem is after I design a post with GUTENBERG how can I save this as a post template to reuse for future post ?

custom post template design with dropdown option Hi problem is after I design a post with GUTENBERG how can I save this as a post template to reuse for future post ?

Share Improve this question asked Feb 18, 2020 at 19:28 learning wordpresslearning wordpress 1
Add a comment  | 

1 Answer 1

Reset to default 0

To make a template that appears in the specific dropdown menu you're referencing, you need to create a file in the theme (or child theme). Let's say you're creating "tpl-events.php". Inside the file you'll add comments at the top:

<?php
/*
* Template Name: Events
*/
?>

The template will then appear in any post type that allows custom templates. If you'd like to specifically allow the template to be used in a CPT, you can add another comment:

<?php
/*
* Template Name: Events
* Template Post Type: page, event
*/
?>

If you're instead wanting to create a template of blocks to use on a page, you can either:

Create a reusable block - group all of your blocks in a single Group block and use the three-dot menu to select the Reusable Blocks option.

or

Set up a CPT template - if you'd like to have empty blocks added whenever you create a new post of a certain type, you can set this up either where the post type is registered or else add a filter.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744738027a4590864.html

相关推荐

  • custom post template design with dropdown option

    custom post template design with dropdown optionHi problem is after I design a post with GUTENBERG how can I save this

    1天前
    60

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信