we have the salient theme active and use the WPBakery as an editor.
We have created a custom post type and selected the role manager capability to use the WPbakery as an editor for the custom post type and use the custom blocks which come with the salient theme.
Now the issue is, that the same element has the proper padding, margin, color, etc generated by NectarElDynamicStyles::generate_styles() for pages/posts. But not for the pages created by Custom post types.
We noticed that the method NectarElDynamicStyles::generate_styles(), works around with the custom meta fields created for pages/posts within the salient core. And since we don't have the same meta fields available for the pages created using the Custom Post Type, the NectarElDynamicStyles::generate_styles() method is not working for the CPT.
Is there any way, we can assign the meta fields to the CPT as well, so that we have the dynamically generated styles apply to the pages created for CPT using the WPBakery blocks?
Could you allow us to log in to your website backend dashboard so we can check on this for you more?. We are gonna need the username and password of admin user as well as the login url.
Hey Aris, is looks like your custom post type is getting skipped from the dynamic style generation because it's set as an "archive", and archives get skipped from that generation by default.
If you can't change your CPT setup, you can manually force the CSS generation for your post type by adding the following snippet to your Salient child theme functions.php:
Hi Tahir, Thank you for your support. I tried it and it worked. now the page is getting the dynamic inline css applied to it. your help is much appreciated.
Hi Tahir, We noticed that even after the dynamic inline CSS is applied after using your code, somehow the dynamic style is still rendering the wrong output.
for example, if we choose the "Column Padding" in the "Column setting" of Wpbakery builder for 4%, the inline dynamic style generated is 2%. And for any value I choose, the style is always for 2% class and then it doesn't work.
I have tried to find the solution but unable to do so.
My hunch is that the following piece of code is working only for the first the_content() method. and ignore other available the_content() on the page.
Could you allow us to log in to your website backend dashboard so we can check on this for you more?. We are gonna need the username and password of admin user as well as the login url.
My Bad, The Screenshot does not seem to have gotten attached. I have already added in the code to output the stylesheet in the Archive template. See screenshot:
Hello,
we have the salient theme active and use the WPBakery as an editor.
We have created a custom post type and selected the role manager capability to use the WPbakery as an editor for the custom post type and use the custom blocks which come with the salient theme.
Now the issue is, that the same element has the proper padding, margin, color, etc generated by NectarElDynamicStyles::generate_styles() for pages/posts. But not for the pages created by Custom post types.
We noticed that the method NectarElDynamicStyles::generate_styles(), works around with the custom meta fields created for pages/posts within the salient core. And since we don't have the same meta fields available for the pages created using the Custom Post Type, the NectarElDynamicStyles::generate_styles() method is not working for the CPT.
Is there any way, we can assign the meta fields to the CPT as well, so that we have the dynamically generated styles apply to the pages created for CPT using the WPBakery blocks?
Please let us know.
Hey Again,
Could you allow us to log in to your website backend dashboard so we can check on this for you more?. We are gonna need the username and password of admin user as well as the login url.
Thanks.
ThemeNectar Support Team
Hey Again,
This should help: https://themenectar.com/docs/salient/metabox-cpt
Thanks.
ThemeNectar Support Team
Hey Again,
Unfortunately, we can help further troubleshoot it without taking a look at how the Custom Post Type content is displayed in the Backend.
Thanks.
ThemeNectar Support Team
Hey Aris, is looks like your custom post type is getting skipped from the dynamic style generation because it's set as an "archive", and archives get skipped from that generation by default.
If you can't change your CPT setup, you can manually force the CSS generation for your post type by adding the following snippet to your Salient child theme functions.php:
Kind regards
Hi Tahir, Thank you for your support. I tried it and it worked. now the page is getting the dynamic inline css applied to it. your help is much appreciated.
Thank you!
Hi Tahir, We noticed that even after the dynamic inline CSS is applied after using your code, somehow the dynamic style is still rendering the wrong output.
for example, if we choose the "Column Padding" in the "Column setting" of Wpbakery builder for 4%, the inline dynamic style generated is 2%. And for any value I choose, the style is always for 2% class and then it doesn't work.
I have tried to find the solution but unable to do so.
My hunch is that the following piece of code is working only for the first the_content() method. and ignore other available the_content() on the page.
please check the attached screenshot.
Thank you!
Attached files: 4%-column-padding.png
wpbakery-column-padding.png
Hey Again,
The previous user/pass does not seem to work.
Could you allow us to log in to your website backend dashboard so we can check on this for you more?. We are gonna need the username and password of admin user as well as the login url.
Thanks.
ThemeNectar Support Team
Hey Again,
Just added in this code to generate the dynamic styles for the content in the archive template.
Thanks.
ThemeNectar Support Team
Hi Tahir,
sorry, I don't understand. Did you update the code in this thread? because it's the same as the previous one. Or did you miss writing the code here?
Or did you added the code on the site itself? if so, please let me know where.
Thank you.
Hey Again,
My Bad, The Screenshot does not seem to have gotten attached. I have already added in the code to output the stylesheet in the Archive template. See screenshot:
ThemeNectar Support Team
Thank you again. I just tested it and It worked as expected. As always appreciate your help on the matter.