palasthotel / grid-wordpress

a reference implementation of grid for wordpress
5 stars 5 forks source link

Make grid child-theme-proof #93

Closed JanaME closed 6 years ago

JanaME commented 6 years ago

Hi @EdwardBock,

I found a bug when using a child-theme. If the parent theme overwrites grid-templates and you want to overwrite that in child-theme, it doesn’t work, because grid only looks for templates in parent theme.

e.g. https://github.com/palasthotel/grid-wordpress/blob/master/wordpress_plugin.php#L269

You need to replace get_template_directory() with get_stylesheet_directory() in the first place and if that’s empty you can have a look at get_template_directory()

This is also the case for the grid-stylesheet-overwriting (https://github.com/palasthotel/grid-wordpress/blob/master/wordpress_plugin.php#L199).

EdwardBock commented 6 years ago

Thanks @JanaME

I've added this fix a57b6d380a36c60d126c199d484408e1cdd0f72b

EdwardBock commented 6 years ago

Comes with release 1.7.1

EdwardBock commented 6 years ago

For grid/default-frontend.css have a look at 9ebd1ee

JanaME commented 6 years ago

@EdwardBock works now! Had to fix a small tippfehler (2940625) ;)