I am new to WordPress. I was referring to code of WordPress theme. I am confused about where to put our function and add_action()
for that function.
I want to know whether it is right to define function and add_action
in one PHP file and put it anywhere in our theme folder.
"functions.php" is the file where you want to put your custom functions, hooks and actions. If your theme doesn't have a functions.php just create it. Wordpress will get the contents of it automatically, so you will have access to defined functions anywhere in your theme.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With