• Hi. I’ve been looking into cachebusting a child themes stylesheet with versioning.

    The option in Section #3 of the below link works and allows me to control the versioning of the child theme’s stylesheet.

    https://developer.wordpress.org/themes/advanced-topics/child-themes/

    However, before where I was using the option without cachebusting it conveniently loaded the child’s stylesheet at the end of all the other stylesheets of the themes and plugins. With the cachebusting option, it works with versioning, but with the dependency option it loads it right at the top.

    Any ideas of how I might control this better? Without listing a dependency ID it will actually output two child theme stylesheets. I’ve also tried to add a priority to the add_action(), but that creates more weirdness.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter WPWanderer

    (@wpwanderer)

    Also, note, that I have also tried listing dependencies in the array when enqueuing the child theme stylesheet. This seems to work, but becomes pretty cumbersome.

    Out of child and parent, the child will load first.
    For running the setup functions, if they use the same priority, the child will run first since it was loaded first. Otherwise, it is the priority order.
    For the actual style order, the dependency parameters are important. So if the child style needs the parent to go first, it better put the parent style as a dependency. Be sure you use the style handle, which is the name in quotes that is used in the parent theme, not the style file name.

    If there are two requests to load the same thing, the second is ignored.

    • This reply was modified 7 years, 4 months ago by Joy.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Cachebusting the Child Theme stylesheet..’ is closed to new replies.