Template file name as help when using Themler

Stagger Lee
1796 Posts
Stagger Lee posted this 22 April 2015

Add this in Themler as option in settings (to be able to switch on / off) and it will help your Users and spare you huge amount of support questions.
This is for WordPress. It gives on frontend and in Themler backend window in the bottom right corner name of template file currently used on this page.


// Shows file name at right down corner
function whatever(){
function tp_template_name() {
global $template;
$html = '<div style="font-family: sans-serif; background: yellow; z-index: 99999; position: fixed; bottom: 0; right: 0; padding: 5px 25px; font-size: 18px; color: black; ">';
$html .= basename($template);
$html .= '</div>';
echo $html;
}
if (is_user_logged_in()) {
add_action('wp_footer' , 'tp_template_name');
}
}
add_action( 'init', 'whatever' );

Add this in Themler as option in settings (to be able to switch on / off) and it will help your Users and spare you huge amount of support questions. This is for WordPress. It gives on frontend and in Themler backend window in the bottom right corner name of template file currently used on this page. ---------------------------------------------------- // Shows file name at right down corner function whatever(){ function tp_template_name() { global $template; $html = '&lt;div style=&quot;font-family: sans-serif; background: yellow; z-index: 99999; position: fixed; bottom: 0; right: 0; padding: 5px 25px; font-size: 18px; color: black; &quot;&gt;'; $html .= basename($template); $html .= '&lt;/div&gt;'; echo $html; } if (is_user_logged_in()) { add_action('wp_footer' , 'tp_template_name'); } } add_action( 'init', 'whatever' );
Vote to pay developers attention to this features or issue.
9 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 22 April 2015

Hello Stager Lee,
thank you for your suggestion. I've added it to our wish list.
Lets VOTE for it.

Regards,
Aileen

Hello Stager Lee, thank you for your suggestion. I've added it to our wish list. Lets **VOTE** for it. Regards, Aileen
mariechausse83
2 Posts
mariechausse83 posted this 22 April 2015

If you want, I translated in french the themler theme if you want to use it ...

If you want, I translated in french the themler theme if you want to use it ...
Stagger Lee
1796 Posts
Stagger Lee posted this 22 April 2015

Worth to note, only Admins see this notice about template filename.

Worth to note, only Admins see this notice about template filename.
Support Team
Support Team posted this 22 April 2015

Hello mariechausse83 ,
please create a new private topic http://answers.billiondigital.com/Topic/Create?private=1 to discuss the translation.
Thank you.

Regards,
Aileen

Hello mariechausse83 , please create a new private topic http://answers.billiondigital.com/Topic/Create?private=1 to discuss the translation. Thank you. Regards, Aileen
Stagger Lee
1796 Posts
Is Solution
Stagger Lee posted this 23 April 2015

Sorry, this is right snippet for Admins eyes only. Other roles dont see it.

// Shows file name at right down corner
function whatever(){
function tp_template_name() {
global $template, $current_user;
get_currentuserinfo();
/* If you have more than one user deny. Be sure to use your user ID! */
if ( !current_user_can( 'manage_options' ) )
return;
$html = '<div style="font-family: sans-serif; background: yellow; z-index: 99999; position: fixed; bottom: 0; right: 0; padding: 5px 25px; font-size: 18px; color: black; ">';
$html .= basename($template);
$html .= '</div>';
echo $html;
}
add_action('wp_footer' , 'tp_template_name');
}
add_action( 'init', 'whatever' );

Sorry, this is right snippet for Admins eyes only. Other roles dont see it. // Shows file name at right down corner function whatever(){ function tp_template_name() { global $template, $current_user; get_currentuserinfo(); /* If you have more than one user deny. Be sure to use your user ID! */ if ( !current_user_can( 'manage_options' ) ) return; $html = '&lt;div style=&quot;font-family: sans-serif; background: yellow; z-index: 99999; position: fixed; bottom: 0; right: 0; padding: 5px 25px; font-size: 18px; color: black; &quot;&gt;'; $html .= basename($template); $html .= '&lt;/div&gt;'; echo $html; } add_action('wp_footer' , 'tp_template_name'); } add_action( 'init', 'whatever' );
Support Team
Support Team posted this 23 April 2015

Hi Lee,
thank you for your suggestions and code snippets. I passed them all to developers team for review.

Regards,
Aileen

Hi Lee, thank you for your suggestions and code snippets. I passed them all to developers team for review. Regards, Aileen
Stagger Lee
1796 Posts
Stagger Lee posted this 23 April 2015

I am making all those topics for manual use if people need it. But if your developers find it easy to implement as option in Themler you are welcome.

I will write it I think it should / need to be in the Themler core.

I am making all those topics for manual use if people need it. But if your developers find it easy to implement as option in Themler you are welcome. I will write it I think it should / need to be in the Themler core.
Support Team
Support Team posted this 28 April 2015

Hello Stagger Lee,
just to let you know: we're working on the public SDK which describe how to create custom controls. So it'd be possible to create special control that outputs a theme name and add it to a theme.

regards,
Aileen

Hello Stagger Lee, just to let you know: we're working on the public SDK which describe how to create custom controls. So it'd be possible to create special control that outputs a theme name and add it to a theme. regards, Aileen
Stagger Lee
1796 Posts
Stagger Lee posted this 28 April 2015

Thanks Aileen. Hope it wont be to complicated.

Thanks Aileen. Hope it wont be to complicated.
You must log in or register to leave comments