When does WordPress begin to load current theme file?

Although wordpress reads files of themes to get the theme information to display in the administraion panel, the load of active theme(such as load of theme specific functions) is done only after the name of the current theme  is determined.

WordPress stores the name of  the active theme in database table wp_options. wp_templating_constants() in wp-settings.php gets that name from “template” option and saves it in the TEMPLATEPATH constant. Then wp-settings.php will load the wodpress theme file “functions.php” in the directory wp-content\themes\TEMPLATEPATH\. In functions.php, you can load as many files of your theme as you wish, or call add_actions, add_filters,…, as done at plugin activation time. Knowing the mechanism wodpress gets active theme name, next time if the active theme is broken, and you even can not login to the administration panel to switch the theme, you can change the active theme in the database manually.

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:

Leave a Reply