Use get_stylesheet_directory() for override folders in child theme by JSn1nj4 · Pull Request #2 · TypeRocket/plugin · GitHub
Skip to content

Use get_stylesheet_directory() for override folders in child theme - #2

Open
JSn1nj4 wants to merge 1 commit into
TypeRocket:mainfrom
JSn1nj4:fix/get-active-theme-directory
Open

JSn1nj4 wants to merge 1 commit into
TypeRocket:mainfrom
JSn1nj4:fix/get-active-theme-directory

Conversation

@JSn1nj4

@JSn1nj4 JSn1nj4 commented Mar 30, 2023 •

Copy link
Copy Markdown

Issue

When a child theme is active, the TypeRocket plugin will currently check the parent theme for override folders. This is because the function get_template_directory() will find the parent of a child theme if a child theme is active.

Source: get_template_directory() function

In the case a child theme is being used, the absolute path to the parent theme directory will be returned. Use get_stylesheet_directory() to get the absolute path to the child theme directory.

Solution

Use the function get_stylesheet_directory() instead as recommended by the above docs.

@JSn1nj4

JSn1nj4 commented Mar 30, 2023 •

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant