Widgets Bundle carousel CSS not enqueued on the static front page

Open 5 replies pluginplugin-page-builderquestion
Started · Latest reply by Andrew Misplon

Bug: SO Widgets Bundle carousel CSS not enqueued on the static front page (WordPress 7.1)

Summary

After upgrading WordPress from 6.8.8 to 7.1, the CSS assets required by `sow-anything-carousel` widgets (Slick + carousel-specific stylesheets) stop being enqueued **only on whichever page is set as the static front page** under Settings → Reading. The exact same widget, with identical content, works correctly on any other (non-front-page) page using the same template.

Environment

– WordPress: 7.1 (issue appeared immediately after upgrading from 6.8.8)
– Page Builder by SiteOrigin: 2.36.0
– SiteOrigin Widgets Bundle: 1.74.2
– Theme: custom theme (not a SiteOrigin theme)
– Other active plugins: Yoast SEO, Duplicate Post (ruled out via conflict testing — see below)


Steps to reproduce

1. Create a page with two `sow-anything-carousel` widgets added via Page Builder (Anything Carousel widget).
2. Set that page as the static front page under Settings → Reading.
3. View the page while logged out (and logged in) in any browser.
4. Compare the “ output to the same page when it is **not** set as the front page (e.g. duplicate the page, or temporarily set a different page as the front page).

**Expected:** the following are enqueued and present as “ tags in “:
– `slick.css` (`/wp-content/plugins/so-widgets-bundle/css/lib/slick.css`)
– `anything-carousel/css/style.css`
– The per-instance generated stylesheet(s) under `/wp-content/uploads/siteorigin-widgets/sow-anything-carousel-base-{hash}-{page_id}.css`

**Actual:** none of the above are enqueued when the page is the front page. All other page-specific SiteOrigin Panels CSS (`siteorigin-panels-front-css`, the inline `#pl-{id}` layout styles) load correctly. The widget HTML itself renders correctly and completely (all carousel items, images, and text are present in the page source) — only the stylesheet “ tags are missing, so the carousel displays unstyled (items stacked, no slick positioning, no arrows/dots layout).

What we’ve ruled out

– **Caching:** no caching plugin installed; issue reproduces in multiple browsers (Chrome, Firefox) and incognito/logged-out sessions.
– **Theme templates:** issue persists regardless of which page template is assigned to the front page (custom `page.php`, a custom “Landingpage” template that doesn’t even call `get_header()`/`get_footer()` the same way). Reassigning templates makes no difference.
– **It’s tied purely to the “is front page” designation, not to page ID or content:** duplicating the front page and testing the duplicate (not set as front page) shows no issue. Setting an entirely different, unrelated page as the front page reproduces the same missing-CSS symptom on that page instead.
– **Generated CSS file itself:** the per-instance file (`sow-anything-carousel-base-{hash}-{page_id}.css`) exists on disk with correct content. Manually deleting it causes SiteOrigin to regenerate it correctly — but it is still never linked in “ when the page is the front page.
– **JS errors:** browser console is clean (only the standard jQuery Migrate notice).
– **PHP errors:** `WP_DEBUG_LOG` shows nothing related to SiteOrigin/Panels — only an unrelated deprecated-hook notice from our own theme’s `rest_enabled` filter.
– **Plugin conflicts:** Both SiteOrigin plugins are up to date (Page Builder 2.36.0, Widgets Bundle 1.74.2). No SiteOrigin-specific “Home Page” builder setting is present/enabled in our install.

Suspected cause

We noticed that WordPress 7.1 introduces a new core mechanism, `wp_hoist_late_printed_styles()`, visible via placeholder comments it leaves in “:

html

<style id="wp-block-styles-placeholder-inline-css">
:root { --wp-internal-comment: "Placeholder for wp_hoist_late_printed_styles() to replace with the block styles printed at wp_footer." }
</style>

Since SO Widgets Bundle needs to inspect the actual Panels layout data to know which widget-specific CSS to enqueue, and that inspection can only happen once widgets are rendered during `the_content()` (i.e., after `wp_head()` has already fired), we suspect SO Widgets Bundle’s own mechanism for hoisting late-registered styles into “ may be interacting badly with this new WP 7.1 core hoisting mechanism — specifically in a way that only manifests on the front-page request. We were not able to confirm this in the plugin source, but it’s the most consistent explanation for what we’re seeing.

Current workaround

We’re currently forcing the missing stylesheets to enqueue manually via a `functions.php` snippet, targeted only at `is_front_page()`:

php
add_action( 'wp_enqueue_scripts', function() {
    if ( is_front_page() ) {
        wp_enqueue_style( 'slick', WP_PLUGIN_URL . '/so-widgets-bundle/css/lib/slick.css', array(), '1.8.1' );
        wp_enqueue_style( 'sow-anything-carousel', WP_PLUGIN_URL . '/so-widgets-bundle/widgets/anything-carousel/css/style.css', array(), '1.74.2' );
        wp_enqueue_style( 'sow-carousel-home-1', content_url( 'uploads/siteorigin-widgets/sow-anything-carousel-base-bce3a72a55c8-13.css' ) );
        wp_enqueue_style( 'sow-carousel-home-2', content_url( 'uploads/siteorigin-widgets/sow-anything-carousel-base-96fe56b154c3-13.css' ) );
    }
}, 20 );

This resolves the visual symptom but is fragile — the per-instance filenames contain a hash that changes whenever the widget is edited/re-saved, so the hardcoded URLs need to be updated manually each time. We’d much prefer a real fix so we can remove this patch.

Request

Could someone from the SiteOrigin team confirm whether:
1. There’s a known interaction between SO Widgets Bundle’s style-enqueue timing and WordPress 7.1’s `wp_hoist_late_printed_styles()`, and
2. Whether the front-page-specific asset detection (whatever check differentiates a front page request from a regular page request in the enqueue logic) has a known edge case in the current release.

Happy to provide a site URL, further debug output, or test a patched build if that helps track this down.

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

5
  1. Andrew Misplon Staff

    Hi,

    Thanks for the detailed report.

    I have checked the Widgets Bundle source and tested on a local WordPress 7.1 install. The Widgets Bundle has no front page specific logic. On our test site, with an Anything Carousel page set as the static front page, all three stylesheets were present in the head.

    The hoisting you spotted was introduced in WordPress 6.9. Core captures late styles at wp_footer and inserts them before the closing head tag. If that scan cannot find a closing head tag, the styles are dropped silently.

    It would be good to rule out the theme. Could you switch to a default theme, for example Twenty Twenty-Five, and check the front page again? If the styles load, the next thing to check is whether the theme has a front-page.php file. WordPress uses that file for the static front page regardless of the assigned page template, so it is worth confirming it outputs a closing head tag.

    Kind regards,
    Andrew

  2. kmd

    Hi Andrew,

    Quick update with what we could actually verify — I don’t want to claim more than we can back up.

    Some context I hadn’t mentioned explicitly before: the upgrade path was directly from WordPress 6.8.8 to 7.1, so it crosses the 6.9 boundary you mentioned, where wp_hoist_late_printed_styles() was introduced. That lines up timing-wise with when the bug appeared.

    What we’ve concretely established:

    The issue only occurs with our own theme, not with default themes. We compared two:
    Twenty Twenty-Five (block/FSE theme): no issue
    Twenty Seventeen (classic PHP theme, like ours): also no issue
    We went through our entire theme (header.php, footer.php, page.php, functions.php, style.css). None of these files contain logic that treats is_front_page() conditionally in a way that affects the section or style enqueuing. We even removed functions.php entirely (disabling all of our theme’s hooks/filters) — the bug persisted. That effectively rules out our own code as the direct cause.
    The following filter in our functions.php reliably fixes the problem, even without our old hardcoded workaround:

    add_filter( ‘should_load_separate_core_block_assets’, ‘__return_false’, 100 );

    With that in place, the carousel styles load correctly on the front page again.

    Important — we can NOT cleanly explain this part: this filter is not set in Twenty Seventeen (its default there remains true), and Twenty Seventeen doesn’t show the bug regardless. So while the filter demonstrably fixes the symptom for us, we can’t prove that should_load_separate_core_block_assets is actually the root cause — it’s possible the filter only hits a side effect, and the real difference between our theme and Twenty Seventeen lies somewhere else that we can’t identify without visibility into the relevant core code.

    In case it’s useful for your team: we don’t have any WP_DEBUG_LOG entries for this, because no PHP error or warning ever occurred at any point — the enqueue silently fails to happen, with no error output at all.

    If you have any hypothesis about which theme characteristic (add_theme_support flags, template structure, etc.) might account for the difference, we’d be happy to test that specifically.

    Best regards Kai

  3. Andrew Misplon Staff

    Hi Kai

    Thanks for the update. Can you perhaps upload a ZIP folder of your theme to Dropbox or Drive, something like that, and share the link? That might be the fastest way to lend a hand.

    • kmd

      Hi Andrew,

      Unfortunately, that’s not possible. Could you perhaps take a look directly at the source code? Here is the client’s website: https://www.dmc-datenschutz.de

      We are now certain that “should_load_separate_core_block_assets” fixes the error. Perhaps a workaround could be integrated into SiteOrigin?

      Best regards Kai

  4. Andrew Misplon Staff

    Hi Kai,

    Thanks for the link.

    Ignore my closing head tag suggestion, your markup parses fine.

    I compared the front page against the Datenschutzbeauftragter page to see when the widget CSS is enqueued. On the interior page it is in the head. On the front page it is at the end of the document. So it is enqueued later on the front page.

    Your filter is masking the fault. On a staging copy, could you remove it, load the front page and send me the full source? Leave it in place on live.

    I would rather not ship that filter for everyone, it changes CSS loading on every site. Before we can consider a change, we would need to replicate the issue here.

    Thanks

Please log in to post on our forums. Signing up is free.

Have a different question or issue?

Start New Thread