Global class on post content doesn't get applied in post editor

I have a global class applied to a Post Content element inside of my Blog Single template.

When loading a blog post, the global class doesn’t apply to the parent container anymore.

I use this class to apply post styling on both the front-end & back-end.

If I cycle through breakpoints, the class gets added.

This issue only started occurring after one of the recent updates.

EDIT: Just realized that most of the time it works fine, but some times it doesn’t. Trying to pinpoint what the difference might be.

I’ve noticed the same issue. It works fine with the index template, but there seem to be problems with other templates. Initially, it functions correctly, but when you save the page and reload it, or change the template from the page settings, the global post content class isn’t always loaded. As a result, any added relative styling is missing. This causes a styling difference between the frontend and backend.

Are you on WP 6.4.1, or still on 6.3?

I’m still experiencing the issue on 6.3, but it seems to work on my 6.4.1 staging site (just waiting for a different bug to get fixed before updating).

Nvm, I just updated to 6.4 and still have it happening.

@Araminta has anyone else reported this? I believe this might be a bug.

with 6.4.1 it is working perfectly now,
once it happen did not work in accident,
i will turn on/off the global class green/red dot, this can help for me.

I am using WordPress 6.4.1, and the issue is still there. At first, it seemed random, but now I have noticed an exact pattern: when I create a page, it works fine, and it also works fine after a page reload. However, as soon as I adjust the page template settings and select any template other than the default template, the problem occurs.

Hi @sunny,

Sorry for the delayed response.

Thank you for pointing this out!
And thank you @krievinshj for confirming this on your end too.

Indeed, a global class applied to a template’s post content other than the Index won’t display correctly in the editor.
I can confirm this is a bug.

We’ll be sure to have a fix for this as soon as possible.

For the time being, as Sunny pointed out, cycling through breakpoints applies the global class.

Apologies for the inconvenience.

1 Like

Hello @sunny,

Thanks for the report.
1.3.4.2 should come with a fix for this specific issue.

Please let us know if you still experience trouble on your end.

Cheers,

1 Like

Hi @Louis,

I’m not sure when exactly this regressed, but it seems to be a bug again? Global classes on the Post Content element aren’t being used in the backend DOM.

EDIT: Actually, looks like it does get applied if you Force iFrame.

1 Like

Good catch @sunny . We usually always use this, so I haven’t tested without recently.

1 Like