-
AuthorPosts
-
December 18, 2024 at 1:49 pm #1473900
On this page (and on all the other posts):
You can see at the bottom that I have used the backcolor: #ea675b
It is like this on all the posts.How can I change this specific color to another site wide?
It is not used in the General Styling color scheme, so I cannot make any changes there.December 18, 2024 at 3:54 pm #1473903December 18, 2024 at 4:43 pm #1473911Hmmm.. this does not answer my question. It has nothing to do with the socket color.
December 18, 2024 at 4:48 pm #1473917Sorry see now that I was not clear. It is the red volor in the post I speak of. This is used on many post, and I wonder if Can replace it easily without doing it manually.
December 18, 2024 at 5:04 pm #1473928Hi,
Please try the following in Quick CSS under Enfold->General Styling:
.flex_column.av-4t8hpm1-f559d972322056e38a53d97313012af9 { background-color: green; }
Best regards,
RikardDecember 18, 2024 at 5:35 pm #1473932you are talking about the background-color of that flex_column
this does not come from a theme setting – it is set inside the column itself. You can open that column element in the editor mode and change the background-color.
I do not recommend addressing all flex_columns with a global CSS code.
December 18, 2024 at 5:40 pm #1473933Or do you belong to the buttons?
you can insert your wanted color to : General Styling – Main Content – Primary Color
but that will only work if the buttons are on default setting. If they are inserted with custom settings – it will have no effect.
December 18, 2024 at 5:47 pm #1473935Yes it is both the button and the column that now have the wrong profile color #ea675b (the company just changed their color profile).
I have been trying to find plugins that can find & replace all colors that are #ea675b to a new color that can be #0000DD – but without luck.
I know how to change it manually, but since there are over 200 posts, – now with the wrong color in the column and on the button
– I wonder if there is a quick fix.December 18, 2024 at 5:51 pm #1473936ok – you can try first the last tip.
Then i will have a look if we can address it by attribute selector.December 18, 2024 at 5:55 pm #1473937You mean this on?
.flex_column.av-4t8hpm1-f559d972322056e38a53d97313012af9 {
background-color: green;
}Tried it. Nothing happens, – also this goes just to that one specific column no?
December 18, 2024 at 5:57 pm #1473939The colors are not not set with default as you mention above, but custom…
December 18, 2024 at 7:11 pm #1473951no – this: https://kriesi.at/support/topic/change-a-color-sitewide/#post-1473933
but: Really now? – I thought we were talking about a few hundred posts that need to be changed. I would change the few things manually. Honestly – it is better to change the background color on generation than to change it afterwards via css or script.
open the column and replace the color.
December 18, 2024 at 7:15 pm #1473952please insert this to your child-theme functions.php:
(maybe a mod knows a shorter way)function replace_one_specific_color(){ ?> <script> window.addEventListener("DOMContentLoaded", function () { (function($) { function colorReplace(findHexColor, replaceWith) { // Convert rgb color strings to hex // REF: https://stackoverflow.com/a/3627747/1938889 function rgb2hex(rgb) { if (/^#[0-9A-F]{6}$/i.test(rgb)) return rgb; rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); function hex(x) { return ("0" + parseInt(x).toString(16)).slice(-2); } return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); } // Select and run a map function on every tag $('.flex_column, .avia-button').map(function(i, el) { // Get the computed styles of each tag var styles = window.getComputedStyle(el); // Go through each computed style and search for "color" Object.keys(styles).reduce(function(acc, k) { var name = styles[k]; var value = styles.getPropertyValue(name); if (value !== null && name.indexOf("color") >= 0) { // Convert the rgb color to hex and compare with the target color if (value.indexOf("rgb(") >= 0 && rgb2hex(value) === findHexColor) { // Replace the color on this found color attribute $(el).css(name, replaceWith); } } }); }); } // Call like this for each color attribute you want to replace colorReplace("#ea675b", "#0000DD"); })(jQuery); }); </script> <?php } add_action('wp_footer', 'replace_one_specific_color');
December 18, 2024 at 7:24 pm #1473953By the way – I would probably replace the color in the database – but that’s something I’d hesitate to explain to a non-technical user.Maybe using a plugin https://wordpress.org/plugins/better-search-replace/ will help you.
(my table prefix is not for the public)
Probably only these 3 tables are affected:
( _options , _postmeta , _posts)after replacement you can deinstall that nice Plugin.
December 18, 2024 at 9:20 pm #1473957Yes, still taking about a few hundred posts (249). But thank u so much,- I will try what you suggest :)
December 19, 2024 at 7:11 am #1473992The mark on “Run as dry run” had to be unchecked if you like to change something to database. That was only a test run for checking if a color could be substituted this way.
-
AuthorPosts
- You must be logged in to reply to this topic.