Title: wp_before_load_template
Last modified: October 11, 2023

---

# wp_before_load_template

 *  [capbussat](https://wordpress.org/support/users/capbussat/)
 * (@capbussat)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/wp_before_load_template/)
 * In a plugin amb trying to use this filter: **wp_before_load_template**; I use
   it like
 * add_action(‘wp_before_load_template’,’my_function_before_load_template’, 20, 
   3);
 * But I can not get any log neither in the Site Editor or in the front end.
 * I am using a block theme (Twenty Three) and WP 6.3.1 on a local host.
 * What I am doing wrong?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/wp_before_load_template/#post-17117413)
 * That action only fires when PHP templates are loaded for a classic theme. It’s
   not used with block themes like 2023. Block theme templates are loaded through
   a different mechanism. That’s all I know. IDK what that mechanism might be, sorry.
 * What are you actually trying to do with that action hook? Maybe someone else 
   can suggest an approach compatible with block themes.
 *  Thread Starter [capbussat](https://wordpress.org/support/users/capbussat/)
 * (@capbussat)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/wp_before_load_template/#post-17119546)
 * Thanks, I am trying to get the information about which template is loaded for
   a page/post in a block theme.
 * I think I will look into template.php, template-loader.php and post-template.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wp_before_load_template’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [capbussat](https://wordpress.org/support/users/capbussat/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/wp_before_load_template/#post-17119546)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
