Skip Navigation

[Resolved] Custom CSS in a View content template not working

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 17 replies, has 2 voices.

Last updated by Nigel 5 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#1182207

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2019-01-11 at 11.58.25.png

I did some testing on your site (I set up my own View "Nigel" and inserted it on my own page "Nigel View" with just a single body style rule in each of the locations so I could easily identify what was happening).

You can see in the screenshot that the custom CSS I added to the View (in two place, the Loop Editor, and the inline Content Template) was added just before the closing head tag.

But I found that the layouts CSS was added differently than on my own site (*before* the custom CSS from the View, but after the custom CSS added via the Customizer).

However, there is one critical piece of information you neglected to mention.

You are using a plugin to minimise and concatenate scripts and stylesheets, so the Layouts CSS which is added via a linked stylesheet gets bundled with the theme CSS, whereas the Views CSS isn't affected because it is not enqueued in the same way. (I'm not sure about the Customizer CSS, I didn't dig into that.)

Anyway, the key point is that if you have another plugin bundling the CSS and JS then we can't say for sure how that will happen in what order.

It will be a case of trial and error to determine the order. Once you have established the order, I would expect it to be consistent on the same site, but it would nevertheless account for why you see a different order than I do.

#1182244

Nigel,

Which plugin is causing the unexpected results?

As far as I recall, I'm not adding any custom CSS anywhere else but inside the Toolset utilities.

#1182267

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I think it is the W3 Total Cache plugin which is minimising and concatenating your CSS and JS.

I'm not particularly familiar with the plugin, but I think it has options to include/exclude particular files if you went down that route.