How to trigger function on theme delete?

As long as you don’t delete your theme by ftp, but use the regular way of switching to another theme in the admin, there is a hook to use, switch_theme. It works like this: add_action(‘switch_theme’, ‘mytheme_setup_options’); function mytheme_setup_options () { delete_option(‘mytheme_option1’); delete_option(‘mytheme_option2′); } There’s a sister hook called after_switch_theme, which you could use, for instance, … Read more

get_template_directory has an odd functionality

It is a bug the get_template_directory(); should not return a string that looks like that, try making another installation of WordPress, and echo the get_template_directory(); and see if the output is the same, if it is not then there is something wrong with the first installation.

How to run word press theme on localhost in Ubuntu OS?

Here is two method for downloaded theme. Then login as admin and navigate Dashboard >> Appearance >> Themes. Then click on Add new button then click on Upload theme button and browse download theme zip file like theme.zip. and click on install button. After installing theme click on activate theme button. Note : Your wordpress … Read more

Problem in theme installing?

Log in to your server via SSH, upload the zip file to the /var/www/html/wordpress/wp-content/theme/ directory, then extract it. If you have a control panel, upload and extract the theme using the control panel file manager. Once finished, go to WordPress administration back-end and activate the theme. If you have SSH access to your server, check … Read more