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

front-end.css not loaded in public site #141

Closed
bugsysop opened this issue Dec 5, 2018 · 3 comments
Closed

front-end.css not loaded in public site #141

bugsysop opened this issue Dec 5, 2018 · 3 comments

Comments

@bugsysop
Copy link

bugsysop commented Dec 5, 2018

If I change this declaration in functions.php of my child theme:

// Defines the child theme (do not remove).
define( 'CHILD_THEME_NAME', 'Genesis Sample' );
define( 'CHILD_THEME_URL', 'https://www.studiopress.com/' );
define( 'CHILD_THEME_VERSION', '2.7.0' );

to

// Defines the child theme (do not remove).
define( 'CHILD_THEME_NAME', 'My Theme' );
define( 'CHILD_THEME_URL', 'https://www.studiopress.com/' );
define( 'CHILD_THEME_VERSION', '1.0' );

The front-end.css file for Gutenberg is not loaded anymore in site header

@nickcernis
Copy link
Collaborator

Thank you for this report, @bugsysop.

This is because the front-end.css file depends on the genesis-sample stylesheet by name here:

wp_enqueue_style(
'genesis-sample-gutenberg',
get_stylesheet_directory_uri() . '/lib/gutenberg/front-end.css',
array( 'genesis-sample' ),
CHILD_THEME_VERSION
);

If you rename your theme, it's best to also rename all genesis_sample and genesis-sample strings to match your new theme name in the code (to my_theme and my-theme), which will prevent issues like this one.

I'll leave this open to look into ways to prevent the need for this, though. We could either:

  • Create an npm script or mini site to make theme renaming easier.
  • Pull the child theme name from the constant automatically and use that in the dependency, instead of hard-coding genesis-sample.

nickcernis added a commit that referenced this issue Dec 5, 2018
Prevents an issue where changing the `CHILD_THEME_NAME` constant stops
the front-end.css stylesheet from being enqueued.

For #141.
@nickcernis
Copy link
Collaborator

Resolved in 69c3f36. The CHILD_THEME_NAME will now be used for the dependency automatically.

I also opened #142 to add the ability to rename the theme more easily via an npm script or mini site.

@nathanrice
Copy link
Contributor

Resolved in 69c3f36. The CHILD_THEME_NAME will now be used for the dependency automatically.

💯

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