Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow theme-loader.php to work with child themes #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

allow theme-loader.php to work with child themes #3

wants to merge 1 commit into from

Conversation

pembo13
Copy link

@pembo13 pembo13 commented Oct 23, 2017

As is the code doesn't work when used in child themes. The two WP function call changes allow this.

@truongwp
Copy link
Owner

truongwp commented Oct 23, 2017

Hi @pembo13,

UPDATED:
Sorry. I'm wrong. I think we should create a file like child-theme-loader.php.
Or an another way is let developer define constants when include gallery meta box.

===
Thanks for the pull request. I think we should check if is child theme, use get_stylesheet_directory(), otherwise, use get_template_directory(). If only use get_stylesheet_directory(), it will cause error in case using child theme but Gallery Meta Box is put in parent theme.

Copy link
Owner

@truongwp truongwp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check is_child_theme()

@pembo13
Copy link
Author

pembo13 commented Oct 23, 2017

@truongwp I believe get_stylesheet_directory works for both parent and child themes. Are you finding that not to be the case?

@truongwp
Copy link
Owner

@pembo13 If Gallery Meta Box is placed in parent theme and you are using a child theme, this will cause error

@pembo13
Copy link
Author

pembo13 commented Oct 23, 2017

@truongwp good point, I'll migrate to a separate file, child-theme-loader.php

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

Successfully merging this pull request may close these issues.

2 participants