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
- How do I access the current post object within a block theme template or pattern?
- Get the name of the template/*html file used
- Worthwhile to restrict direct access of theme files?
- How can I get page slug
- Add custom classes to anchor in wp_nav_menu
- Upgrade from 5.0.4 to 5.1.1 causes $theme to be null
- How to edit an existing WordPress theme? [closed]
- How to alter the text of the post “Excerpt” box label in WordPress post editor?
- How can you develop on a live WordPress installation that is using W3 Total Cache? [closed]
- How to Auto Approve Comments on a Specific Page?
- Excluding categories from “Manage Categories” using a get_terms filter
- Feature Survey – What would you want in a resume theme?
- Select menu on browser resize
- Hard-coded Audio Player
- How to display admin bar when using WP_USE_THEMES = false?
- Responsive class to all the images in the content
- WordPress Errors in generated by theme check plugin [closed]
- How should I store global information such as a phone number so that it is editable through the CMS?
- WordPress nav_menu_css_class theme filter is not being called
- Cannot get full thumbnail size using the_post_thumbnail
- Is it safe to enqueue a font style without putting http or https?
- How can I customize wp_footer, where is the code that controls what this function does?
- Is there a way to activate different theme for specified users? [closed]
- More than one meta field in a single meta box?
- how can I remove the sidebar from my wp homepage [closed]
- current_user_can Not Always Working Properly
- How to develop child theme for thesis
- using jQuery Cycle by Malsup with WordPress Page and Gallery
- Why is the post type on the search result page random?
- Can’t select my block by clicking on it
- How to add infinite scroll?
- How can I have a page on a site that isn’t a ‘Page’ in the WordPress sense?
- get_option in header.php not returning value from customizer
- What happens to child theme if I change to new version of parent theme?
- Show notice just below the search form on the themes page
- Missing tested up to on readme text validator
- Posting page on all subdomains
- How do I build a post_thumbnail based archive? [closed]
- Single translation for many locales
- Display theme layouts [closed]
- Is accessing theme and using customizer GPL distribution?
- How to enqueue javascript for WP Customize options sidebar?
- WordPress 500 Internal server error when activating custom theme [closed]
- How to use add_theme_support(‘html5’)?
- How do I make the most minimal vanilla theme possible with nothing but raw content?
- Can I Set Up Session in WordPress Custom Page
- How to list articles by year based on url?
- Change Responsive Images Maximum Width of 1600px
- How to make theme configurable
- How can I hard code my sidebar?
- wp_nav_menu with default pages menu
- Wordpres core-update theme renames theme folder name
- I’m using wp residence theme and want to display titile above the slider [closed]
- Shortcode IF statment help
- Theme customizer – can’t add section/settings
- StoreFront WordPress theme: How can i create a new Home page with Custom design same as template [closed]
- A post with a clear:both in its css destroy the theme design, and the sidebar is moved to the bottom
- How to hide custom sidebar on mobile
- Custom theme template files
- Custom nav menu not showing
- How to get the theme index.php listed in appearance editor
- Filter to remove the default password on “Your Profile” page
- Creating an option for writing a post without an author attribution for a group blog on WordPress
- How can I add a field for featured image on backend of a custom Taxonomy?
- Gallery functionality in custom theme
- WordPress Animation Adjustments
- theme directory fallback image outputs url and not the image
- Unexpected behaviour of class_exist
- How to make force_balance_tags balance comment tag
- add page items to index
- WordPress theme settings not saving
- Is the date when a theme was activated stored?
- How can I not disable my theme when I want to upload a new version of it?
- Is hand coding required at all?
- Creating a Sub Category Template
- Find callback function of custom meta box
- Exporting wp site as a theme
- What is the general function to add a Widget area (not of a particular type)?
- how can I re-utilize and class on a child theme
- How to manipulate wordpress template tags’ output
- WordPress Custom Search By Alphabet and order by asc and sesc
- Automatically Add Caption Shortcode to Image with Caption Field Filled In
- Adding Metabox Value Using the content filter
- Detect error 404 page to find out the issue
- Incorrect search results in search.php – issue triggered by using `define(‘BodyID’, ‘search’); the_post();` in search.php
- WordPress Footer Widget Processing
- Include title and content of one page in another page
- Mamp pro permalink issues. Pages keep reverting to index.php
- wp_enqueue_script causes page to vanish
- How to create Custom Theme in WordPress 5.5.3 [closed]
- Turning WordPress Into full-featured website?
- Making titles clickable
- Why am I getting posts back when I shouldnt
- How to send async emails in wordpress?