The locate_block_template() function is the main function that resolves the list of possible block templates for any given (queried) page to the final template to use.
In this function, it sets the global variable $_wp_current_template_id. This can be used an identifier for the resolved template file. However, please be aware that since the variable starts with an underscore, this conventionally means that it is a global variable intended for internal WordPress core use only.
Related Posts:
- Correct way to make a custom block theme responsive
- Full site editing templates folder vs block-templates
- Adding copyright notice to page bottom in full site editing template
- Block to show posts from same category
- Full Site Editing, Block Theme, Gutenberg, Site Editor
- FSE Change Post Template to Something Other Than a List
- Correct way of implementing complex navigation in Gutenberg
- How do I access the current post object within a block theme template or pattern?
- Get the name of the template/*html file used
- How to show a custom meta box on the “Quick Edit” screen?
- How to add CSS class to custom logo?
- Display Search Result Count
- theme path in javascript file
- Minimum Template Files for Theme Development
- Are content.php and content-single.php the same?
- Theme Customizer : how to create multiple-level panel
- How to change get_custom_logo() url?
- How to execute conditional script when on new customize.php (Theme Customize) screen
- How to set the default value of a option in a theme?
- How to develop a multilingual theme?
- Add meta-information to theme itself
- Theme elements not translating
- Adding dashicon fonts to the admin of pre 3.8 installs
- How to use bloginfo( ‘template_directory’ ) in array
- Is using eval() ok in this scenario
- Should I update my _s theme?
- Prevent WordPress updates from overriding custom language translations?
- Display site admin profile fields in header.php
- Page template across themes
- WordPress Genesis Child Theme Filter divs
- Displaying part of every child page?
- How do I obtain the post content via a custom meta box inside the editor?
- Append HTML to an LI of wp_list_categories
- Customizer API and add_panel(). Panel doesn’t show
- how to change a theme slug
- How display id of most recent modified post in wordpress?
- I want to get the home root path
- How to add code in the content area in a WordPress theme?
- Bold letters inside excerpt [closed]
- How to make Home Menu( Front Page) use index.php instead of page.php
- Unable to pass variable on theme cusomizer add_settings()
- JavaScript Change focus to password field login page being reset
- Using esc_url with a hard coded url
- Broken template went invisible
- get_theme_mod returning no output
- Select full Image Size on widget “Genesis – Featured Posts”
- Where to find the code that redirects requests on the static page URL to the home page
- How to change database values on theme update
- after renaming my wp-content folder, how do I upgrade my wordpress version?
- Issue on Adding A Class to Bootstrap Navbar Walker Dropdown
- Set parent theme language with custom .mo files
- Broken theme, template is missing
- WordPress page/blog incorporated into static website
- How to reverse engineer the Twenty Eleven background image uploader?
- Theme Development -> Specific Homepage
- Premium theme licensing of php called through AJAX
- WordPress Theme With Modified View
- Issue on Accessing To Ajax Enqeued File to Pass to URL for Ajax Call
- pass wordpress template directory into ajax url call
- jQuery from parent theme loaded with many other scripts in a single min.js file
- Javascript development in Custom Themes
- Custom jquery not code not working in wordpress
- Customize Option Framework
- Under theme folder, what’s sequence of action for index.php, page.php, single.php?
- What Can I do To Achieve this Effect: WIP -> Portfolio
- Trying to link to a php template file but its blank
- Theme author.php transfer
- Can any IDE (eg PHPStorm, VS Code) correctly show functions added via require get_template_directory() string results?
- Array for WordPress Avatar Size and Class
- How can I include custom Gutenberg Blocks in a theme?
- WordPress displaying two different headers, one at top and one below footer
- How to show metabox on page if it is using a template
- Mix it up & WordPress
- two col layout bootstrap 4 with one fixed col and fade in effect on image
- Styling the website via the customizer – do the changes stay after theme update?
- How to toggle WP Customizer Panel and Section with JavaScript API?
- is_active_sidebar() problem
- WordPress uploads do not show up and I see the white screen of death in some cases
- How to fix an issue with customizer live preview?
- Code for creating three vertical columns in WordPress Bootstrap theme
- How to submit a guest post with rich text editor?
- Custom widget not appearing on front end
- Theme Development : License help
- show posts in different styling
- How to throw the “We need ftp info” at a user
- Infinite scroll loads new posts several times
- How to reduce repetitive code
- How to filter content by language with WPGlobus
- Enqueue script/style with multiple GET parameters
- Is it possible to create more than one design in a WordPress theme? [closed]
- wordpress page as website
- Next Post Link not working with parameters to restrict to same term
- How to install Woocommerce without plugin?
- Correct way to make a title a link
- Is there a WordPress theme or plugin with built-in user management
- How To add li class and a class wp_nav_menu() with bootstrap 5 navbar?
- Permalink Setting Changes From Post Name to Default After Changing The Page Name
- How to enable wc_add_to_cart_message?
- Export WordPress theme with modifications for other site
- How to add custom attributes to wordpress block theme