Skip Navigation

[Resolved] each Loop Item in a View is reading the ‘css editor’ contents as “page content”

This thread is resolved. Here is a description of the problem and solution.

Problem:

Within a template >> view, is the html and css 'supposed' to be part of page content

Solution:

Yes, those CSS codes in "CSS Editor" will be output insider HTML body tag as inline CSS codes, so it conducts the problem.

As a workaround, you can try to move those CSS codes into your theme file "style.css", then it will be outputted only once, and in the HTML header tag within theme file "style.css".

Relevant Documentation:

This support ticket is created 5 years, 5 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by tK-4 5 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1282387
keyword-density.JPG
back-end.JPG
front-end.JPG

I am trying to: I am displaying 24 blocks of text using a view shortcode on a Page. It calls a View. Both the Loop Item and the CSS in the view are being used. It displays perfectedly on the front-end. It pulls content and colors from custom fields.

I expected to see: For SEO purposes, when I use any Keyword Density tool to read the page content, I expect to see only words/phrases of the page body, etc., but NOT with any html or css mixed in.

Because the loop is running so many times, the css from the template is out-ranking my keywords, which kills my SEO efforts. Within a template >> view, is the html and css 'supposed' to be part of page content ... or as I assume, basically hidden behind the scenes?

#1282497

Hello,

I assume we are talking about the CSS codes of content template in your screenshot:
hidden link

Yes, those CSS codes in "CSS Editor" will be output insider HTML body tag as inline CSS codes, so it conducts the problem you mentioned above:
It is supposed to be part of page content

As a workaround, you can try to move those CSS codes into your theme file "style.css", then it will be outputted only once, and in the HTML header tag within theme file "style.css".

#1283271

Thanks Luo, worked like a charm. I use a css plugin so can add css per page where needed. I had moved your views css into that per that page. It didn't solve the issue as it still read it per each loop. I thought if I moved it to our theme css file, it too, would read multiple times. You were correct, it didn't. I learned something new.

#1283623

Please elaborate the problem with more details:
It didn't solve the issue as it still read it per each loop.

You can also provide a test site with the same problem, also point out the problem page URL, and where I can edit your CSS codes, I need to test and debug it in a live website.

#1283625

My issue is resolved now. Thank you!
close ticket