Problem:
Is it possible to use that color picker field to somehow modify the css of elements on my page? In other words, I'd like it to be used to specify header color of the background.
Solution:
Yes, you can use that color picker to change color of specific sections by using class/id selector as follows:
<style type="text/css"> .new-bg-color, .site-content,{ background:<?php echo types_render_usermeta( "pick-the-color", array( "user_current" => true ) ); ?> } </style>
In the above code, please replace “pick-the-color” to your color picker field slug.
You can add above code in header.php file and then use ‘new-bg-color’ class in page builder Custom Class section.
Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/functions/#colorpicker
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.
Our next available supporter will start replying to tickets in about 1.71 hours from now. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | - |
- | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | - |
Supporter timezone: Asia/Karachi (GMT+05:00)
This topic contains 2 replies, has 2 voices.
Last updated by 6 years, 10 months ago.
Assisted by: Noman.