I have a question regarding add_action
, can i able to add add_action
in functions.php
that is wp-includes/functions.php
add_action('admin_init','myfunction');
I have a question regarding add_action
, can i able to add add_action
in functions.php
that is wp-includes/functions.php
add_action('admin_init','myfunction');
You must be logged in to post a comment.
You can, but you should not since all your modifications will be overwritten when you upgrade wordpress. Use your theme’s
functions.php
instead.Don’t put it in wp-includes for the reasons rrikesh states. You’re just going to the code on update.
If you have a lot of themes within which you want common functionality, make them children of a parent theme.
The parent can hold all the common code in its own functions.php file and the children will be able to use it.
Review the codex for information on Child Themes and how to implement them.