Output which theme template file a post/page is using in the header of WordPress

This is a tip to help developers when creating or editing a WordPress template. This is a dead simple code and is especially useful for big templates (like a magazine style or e-commerce). It will show which template are being currently used by WordPress.

add_action('wp_head', 'show_template');
function show_template() {
    global $template;
    print_r($template);
}

Compartilhar:

2 Comentários. Comentar

Việt Phạm
21 de fevereiro de 2013 3:07

good

Responder
Daniella
26 de janeiro de 2014 15:49

I constantly spent my half an hour to read this weblog’s articles or reviews all the time along with a cup of coffee.

Responder
Comente