I need to automatically make featured img of post (custom type) as div block backgroung-img - screenshot -hidden link
I tried to substitute a macros in css, but it is not processed - hidden link
Please help.
Thanks.
P.S.: Sorry for my English, maybe you have russian support?=))
You cannot use ShortCodes in CSS style sheets.
This is not possible due to the nature of the CSS language. It won't execute ShortCodes or HTML or PHP.
What you can do is use an absolute URL in the CSS.
But that won't allow you to have a dynamic background (each post with its background as set in the featured Image)
I think you should add this to your Theme with PHP.
As an example, you can edit your single.php or your single-{post-type}.php file, and add a PHP variable that populates the HTML with the Featured Image of each post.
https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
Or, insert it directly into the HTML where you create your .apart-thrumb-wrap DIV:
https://toolset.com/forums/topic/how-to-add-a-custom-posts-featured-image-as-a-background-for-a-div-in-views/
Or, use a Plugin:
hidden link
The main problem is, in Layouts, if you add the class .apart-thrumb-wrap to a Row or Cell setting, you will not be able to use ShortCodes there.
But you can, if you add it to an HTML editor in Layouts, like a Visual Editor or Content Template.
I am not sure where you add the class, so I passed both possibilities above.
Let me know if this helps you.
Unfortunately, CSS is not to be populated with ShortCodes, neither JS.
Those are limitations of the language, not Toolset per se 🙂