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

Honor filtering of Stylesheet URI to allow child themes. #886

Closed
kopepasah opened this issue Jan 19, 2018 · 1 comment
Closed

Honor filtering of Stylesheet URI to allow child themes. #886

kopepasah opened this issue Jan 19, 2018 · 1 comment
Assignees
Milestone

Comments

@kopepasah
Copy link
Contributor

Currently, there is no way to use a child theme with AMP due to the hard coded get_template_directory() . '/style.css'.

https://github.com/Automattic/amp-wp/blob/89e4227edf41a8fe0408e8e855a6dcbbd4ccc13c/includes/class-amp-theme-support.php#L391

As I can see it, there are two options:

  1. Use get_stylesheet_uri(): this would allow child themes to work and allow users to customize the location of the stylesheet (we usually keep it stored in an assets/css directory).
  2. Use get_stylesheet_directory() . '/style.css': this is still a bit restrictive, but would allow the style.css file to either be from the child or current theme. Since child themes require a style.css file, this should always be present when using a child theme.
@westonruter
Copy link
Member

@kopepasah Please give #887 a try. It tries to make enqueueing CSS much more seamless. The only requirement is that you enqueue CSS that exists on the filesystem in a theme/plugin, wp-admin, or wp-includes. It also handles added inline styles, locale stylesheets, and Custom CSS.

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

No branches or pull requests

3 participants