Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #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.

    #1473903

    You can see at the bottom that I have used the backcolor: #ea675b

    i do not see your setting – i can see that on socket – there is the color: #081f5e
    which is then saved from enfold as: –enfold-socket-color-bg

    have a look at: general styling – socket – Socket Background Color

    #1473911

    Hmmm.. this does not answer my question. It has nothing to do with the socket color.

    #1473917

    Sorry 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.

    #1473928

    Hi,

    Please try the following in Quick CSS under Enfold->General Styling:

    .flex_column.av-4t8hpm1-f559d972322056e38a53d97313012af9 {
      background-color: green;
    }

    Best regards,
    Rikard

    #1473932

    you 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.

    #1473933

    Or 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.

    #1473935

    Yes 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.

    #1473936

    ok – you can try first the last tip.
    Then i will have a look if we can address it by attribute selector.

    #1473937

    You 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?

    #1473939

    The colors are not not set with default as you mention above, but custom…

    #1473951

    no – 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.

    #1473952

    please 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');
    #1473953

    By 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.

    #1473957

    Yes, still taking about a few hundred posts (249). But thank u so much,- I will try what you suggest :)

    #1473992

    The 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.

Viewing 16 posts - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.