Skip to content

Use get_parent_theme_file_uri() for theme stylesheets - #150

Open
shail-mehta wants to merge 1 commit into
WordPress:trunkfrom
shail-mehta:fix/parent-theme-stylesheet-uris
Open

shail-mehta wants to merge 1 commit into
WordPress:trunkfrom
shail-mehta:fix/parent-theme-stylesheet-uris

Conversation

@shail-mehta

@shail-mehta shail-mehta commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Description

This is a small parent-theme improvement: load Ipsum’s stylesheets with get_parent_theme_file_uri() so the parent CSS continues to load correctly when a child theme is active.

Ipsum already works well on its own. Relative stylesheet paths and get_stylesheet_directory_uri() resolve to the active theme, which is usually fine, but with a child theme they can point at the child instead of Ipsum. Using get_parent_theme_file_uri() keeps parent style.css and editor-style.css available in both cases, similar to Twenty Twenty-Five.

Changes

  • functions.php
    • Front end: enqueue style.css with get_parent_theme_file_uri( 'style.css' ).
    • Editors: register style.css and assets/css/editor-style.css with get_parent_theme_file_uri().

No intentional visual change when Ipsum is used without a child theme.

Testing Instructions

  1. Start the local environment.
  2. With Ipsum active, check the front end and the Site Editor / page editor.
  3. Confirm styles look the same as before.
  4. Optional: try a minimal child theme and confirm Ipsum’s parent stylesheets still load.
  5. Run npm run lint:php if PHPCS is set up locally.

Use of AI Tools

  • Cursor for the PR Description

@github-actions github-actions Bot added the [Area] Theme Functions Issues or PRs that touch functions.php. label Oct 9, 2026
@shail-mehta
shail-mehta marked this pull request as ready for review October 9, 2026 06:59
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: shail-mehta <shailu25@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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

Labels

[Area] Theme Functions Issues or PRs that touch functions.php.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant