You are obviously using full site editing theme if you have HTML templates. For classic themes you have PHP templates and there you can enter php code.
Full site editing html templates use only blocks in their templates and you can’t use PHP there. You can only use existing or build new block and place block template code there.
So either switch to classic theme, or use existing blocks in your theme to build a template or learn to develop blocks if existing block don’t fit your needs, which is more demanding than PHP development in classic theme templates.
Related Posts:
- How to render a block from php template
- How does printf( __( ) ); work?
- Return HTML Template Page with PHP Function
- How to serialize a Gutenberg block from block attributes in PHP?
- Is there a way to parse shortcodes in PHP?
- is_admin returning false in backend in server side rendered block
- Static Frontpage Pagination – Custom loop
- Get the php template file from other theme folder
- Gutenberg Blocks doesn’t render correctly when using do_blocks
- add_meta_boxes action with refresh on save
- On this day PHP code
- How to loop over custom fields in a page template?
- Use Timber/Twig to pull an image by image ID [closed]
- Unable to set right time in admin and frontend template
- Easiest way to show total number of subpages
- How to return output of the new wp gallery block for automatically Link images To Media file
- Blank space at beginning of tag?
- Link to file in plugin directory from wordpress template?
- Password protecting content in custom template
- Add a Second Menu to a theme that only support 1 menu
- Inject PHP code into “sidebar-content” – code before my WooCommerce sidebar widget?
- How to display user nickname (not display name) in PHP template?
- Custom Template 404 for specific custom post type
- How to properly insert a link to a template in WordPress?
- Custom field value not saving when it contains a URL?
- Render ninja form inside markup
- Mass update excerpt
- How can I get a single php file that is the equivalent of an existing WordPress page?
- How to programmatically add Gallery Block to Existing Post Content
- Gutenberg block – Save PHP function’s output as HTML?
- Custom search results page not working with empty search
- Generate YouTube image thumbnail in a Gutenberg block – ACF + Timber
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- How to show single category archive
- Issues getting PHP to display in category pages
- Change title only in dynamic page
- Secondary navigation menu on one page
- Enable custom logo upload if logo is not in header
- How can I edit the content in index.php? [duplicate]
- Add class to group inner container
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Show a different code on front page to other pages
- Does wordpress templates always in files or in database?
- PHP include is only working in certain places in my custom WP theme
- Use WordPress function in php file
- Adding wrapper elements in the_date() like in the_title()?
- How to get all author posts outside of author templates
- How do I define a lookup table that will work across all PHP elements of the template?
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- How to set a template with wp_insert_post
- Why is a wp function used in current PHP namespace’s callback not resolved to global scope?
- Multiple requests external data api dynamic block gutenberg
- Why does the Woocommerce grouped template prints the unpublished products?
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- parsing nested blocks (in columns, etc) via PHP
- What’s a good way to allow overwriting files within a child theme if I want the same folder structure?
- Advice on creating a WP Archive Template with Custom Taxonomy (get_term_meta)
- Guttenburg and Classic Editor – How to use the custom guttenburg block in classic editor?
- Override Admin menu icon
- How to suppress template-parts in undescores?
- Creating custom page template from existing PHP site
- How do I query a single data value from the wp_metadata table?
- Conditional string comparison failing for basename/slug
- How to add new CSS file to new PHP file
- Some problems calling a function into sprintf() inside functions.php template file [closed]
- Want to unrestrict plugin block
- Additional file upload in Gutenberg page options/featured image
- Add Block Before Entry Title Using PHP
- Gutenberg Blocks and get_option() for styling
- Integrate admin plugin into template. Very interesant (live search + autocomplete with wp rest api, in vanilla js)
- Display articles with a different template in the home page | Solved |
- register_block_type is not working properly
- Categories does not show Block editor WordPress
- Converting Array to String Issue [closed]
- ACF – Custom image for Product Tags not displaying
- Block that renders html saved in a php file
- Polylang and template files
- Show Gutenberg facebook embed with a custom theme
- How to create dynamic templates?
- Change WooCommerce template for PDF – access to custom field
- How to include a function in a template with template tag
- What syntax is this? “{{post.price}}”
- How do I modify the Previous and Next Page posts on blog pages to include “previous” and “next” before the links?
- Access methods in plugin template
- Create dynamic content from one WP page to multiple other pages
- Problems With Query and/or Template Part and/or PHP
- Odd page behaviour after removing sidebar
- get_permalink returning first letter
- Custom Archive Page
- How to refresh a template page on WordPress in 3 seconds – easiest method?
- Twig+WordPress how to use array arguments inside a function?
- How to implement a custom sliding banner? [closed]
- Gutenberg – render_callback does not pass ToggleControl value on frontend
- Add default block css when the block has been added with php?
- Custom Post Type doesn’t have template content when creating programmatically in PHP but does when created in WP Admin
- How to add different menu items on different menus?
- How to enable REST API on custom post type without Gutenberg?
- Get column block count using PHP method render_block
- do_blocks not working with a custom block
- Execute a PHP Function when a Block is used and access it’s attributes