07-26-2023, 03:02 PM
It's not a serious question.
I normally use `get_stylesheet_directory_uri()` when enqueuing scripts in WordPress, which worked fine so far.
I just wonder what's the difference between `get_stylesheet_directory_uri()` and `get_template_directory_uri()` when enqueuing scripts in wordpress.
**According to WordPress Codex:**
- `get_template_directory_uri` -> Retrieve template directory URI for the
current theme.
- `get_stylesheet_directory_uri` ->Retrieve stylesheet directory URI for
the current theme/child theme
Then, `get_template_directory_uri` cannot be used for a child theme?
I normally use `get_stylesheet_directory_uri()` when enqueuing scripts in WordPress, which worked fine so far.
I just wonder what's the difference between `get_stylesheet_directory_uri()` and `get_template_directory_uri()` when enqueuing scripts in wordpress.
**According to WordPress Codex:**
- `get_template_directory_uri` -> Retrieve template directory URI for the
current theme.
- `get_stylesheet_directory_uri` ->Retrieve stylesheet directory URI for
the current theme/child theme
Then, `get_template_directory_uri` cannot be used for a child theme?