WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.3k stars 4.11k forks source link

Classic theme : Block Template Part issue not appearing in Appearance #64201

Open liquiddev03 opened 1 month ago

liquiddev03 commented 1 month ago

Description

Hello Budy, I am creating classic theme using tailwind but I need to add header and footer using gutenberg.

I added below action in my functions.php function my_block_template_part_support() { add_theme_support( 'block-template-parts' ); } add_action( 'after_setup_theme', 'my_block_template_part_support' );

After added this code Parts section not registering in my admin panel under Appearance.

  1. I tested it on more then themes but not worked. my WP version is 6.6
  2. tried to disabled all plugins
  3. tested with health/troubleshoot plugin

Please help me to resolve this issue.

Step-by-step reproduction instructions

  1. Added fresh classic theme
  2. After it added block template part action code
  3. checked on theme section not showing new menu on appearance

Reference : https://learn.wordpress.org/tutorial/using-block-template-parts-in-classic-themes/

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Please confirm that you have tested with all plugins deactivated except Gutenberg.

t-hamano commented 1 month ago

Thanks for the report.

In WP6.6, template parts are part of the pattern screen. You can access it from Appearance > Patterns:

image

Please note that in classic themes, this screen only allows you to edit template parts bundled with the theme; you cannot create new template parts or delete them.

liquiddev03 commented 1 month ago

Thanks for the reply, because I didn't see it on any guide documents so I put the request. I have one an last request Can we make the Pattern file dynamic using ACF pro. I have created custom pattern and I want to add ACF field value on each custom pattern except gutenberg Row html. is this possible.

t-hamano commented 1 month ago

Can we make the Pattern file dynamic using ACF pro

The Block Bindings API should help. For example, you can bind any custom field to a paragraph block.

liquiddev03 commented 1 month ago

Yeah I reviewed before few days ago, but there is some limitations. Like I want to add some repeated data like image and title in list via ACF repeater then how we can embed in block.

I used on binding API image and title as simple but getting difficulty on repeated data. for this reason I choose part section using block_template_part but its html format content.

I need to edit real time data correction with some HTML modification

t-hamano commented 1 month ago

From my understanding, in the current version of Block Bindings API, you cannot bind to a single block such as an array or object. You may want to ask on the ACF forum.