I am trying to display state's names responsively based on what country is selected from a list (via a library).
I reckon I needed to use WP AJAX and Jquery to achieve this goal. I am totally new to WP AJAX and Jquery. For the past two days, I have been reading blogs and forums to achieve the responsiveness. Here I came across two files to add my PHP code snippets which are functions.php AND plugin files.
Question: Should I add the PHP code snippets in themes/functions.php OR plugins/MYPLUGIN/myplugin.php or either one? Why?
Two instances of the blogs I've read:
functions.php
file in a theme is, in essence, a mini-plugin. If you'd like the functionality to be independent of your theme, you should create a plugin; if you want the functionality to be part of your theme, then put it infunctions.php
.