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?
- How important is it to enqueue a theme’s stylesheet?
- How do I remove a pre-existing customizer setting?
- Can a theme be built in React?
- Strict Standards Error bootstrap navwalker
- Why I can’t add a CSS style in this WordPress theme?
- register_sidebar ignores ‘id’ and ‘class’
- Posts in multiple Categories different single.php
- Single Page WordPress Theme – Using page templates
- Confused about image sizing business in WordPress
- Add link option to featured image?
- Creating the modern ‘single page’ html5 css3 layout in wordpress
- esc_url not working within add_settings_field callback
- How to hide and content from auto-generated excerpts?
- How to override BuddyPress 3.0 bp-nouveau theme files?
- Which theme foundry has clean coded themes, where code is poetry [closed]
- Responsive Images – Generating multiple images from Theme Customizer control upload?
- How can a Theme Contain no Header File or Footer File?
- WordPress theme (or plugin) that uses Contenteditable property
- Same footer on all multisites blogs
- Adding “latest from the blog” to the homepage
- Default comments file and how to copy it
- New template, where to place CSS?
- Is there a theme function for is_password_protected()?
- WordPress not registering Theme Customization Section
- How to get comment meta values by post ID
- For best DB performance should I serialize all theme options together or by type?
- Find the Children of a Page then Echo it as a Bulleted List of Links (menu)
- Non-Blog Website without Search: are comments.php and search.php in theme still required?
- Custom Widget options in theme
- Include Parent functions.php in Child Theme functions.php
- Redirect to specified page when insufficient permissions?
- Reasons why all thumbnail sizes aren’t working
- Jetpack Comments with fall-back
- Update a custom theme with Subversion?
- Should I use add_filter for functions in function.php of the theme?
- Multiple TinyMCE Editors in one Admin Page
- wp_script_add_data doesn’t seem to work
- How to override checkbox styles if these inputs have a unique id [closed]
- What are the minimum role/permissions for freelance developer?
- Where am I doing wrong in my theme menu?
- Calculate data and passing to Theme
- Multisite theme path rewrite using .htaccess
- Retrieve localised value
- How to disable wordpress from overload my stylesheet styles with customizer styles
- How can I conditionally show different home page templates based on whether or not the user is logged in?
- how to get the post attachement image in full size?
- Updating a live theme safely?
- How do I remove inline style in featured image markup?
- different way to achive stylesheet_url
- Why is my CSS not loading?
- How to find default functions of wordpress
- How to remove ver from stylesheet URL? [duplicate]
- Using a starter theme vs starter theme with child theme
- How should I use starter content utility to show some default menus?
- Set a featured image as a replacement to the header image
- How to include Google fonts [duplicate]
- How To Detect Posted Comment in Theme Development?
- Create a category archive page in TwentyTen Child Theme
- How to call the_time current?
- where is real values of variables?
- How to add sidebar to Isola theme? [closed]
- How to remove WP Title Tag?
- Change the sidebar from left to right twentyfourteen theme
- Custom theme won’t use search.php
- Get attachment meta (I need attachment ID, unsure how to find it)
- Retrieve WordPress’ the_content() with jQuery
- Minimal WordPress Functionality on Existing Website
- W3 total cach and theme changes [closed]
- How to add testimonials with an image?
- How to setup sidebar modules to use jQuery Accordian
- How to copy page/post from one theme to another?
- Not sure how to debug this npm install error. This is a wordpress theme that comes with a built-in gulp/webpack task automation [closed]
- Add class every 4 post like , class_1, class_2, class_3, class_4 and class_1, class_2, class_3, class_4
- Using has_term() function for category-subcategory structure
- Find the source file causing a Mixed Content warning
- Avoiding do_shortcode() loops
- Why content is not adding for each blog post
- Correct was to customise theme using get_theme_mod in scripts
- Recent post in the middle of the content
- How to figure out which wordpress theme a site was using?
- Best way to allow for extended use of WordPress functions inside single.php
- Redirect to custom login page
- How to close open divs in post loop
- Display Today’s date outside the loop?
- How to Disable Color Options?
- Form to Add Posts to Custom Post Type (Again)
- Creating Multiple Menus in the Thesis Theme?
- Workflow of Collaboration on wordpress development [closed]
- How to make admin theme option with image slide show?
- Explanation of User Roles and Capabilities
- Getting URL of Resized Image
- Detect custom font size