-
AuthorPosts
-
April 14, 2016 at 1:40 pm #613856
I want to completely replace predefined color schemes with my own ones without altering enfold/includes/admin/register-backend-styles.php, but using it as a template (copy/paste) for creating my own color schemes file.
So the question is how could I completely disable any reference to enfold/includes/admin/register-backend-styles.php while creating a new reference or references to my own analogue of register-backend-styles.php via functions.php?
April 14, 2016 at 3:54 pm #614032Hi kacharava!
Thanks for getting in touch with us!
First thing you need to do is ensure you are using a child theme. http://kriesi.at/documentation/enfold/portfolio-item/create-a-child-theme/
Then create a separate file with your custom styles and save it in the child theme directory. Finally in the child theme’s function.php file you need to make the call to that file so it replaces the original https://codex.wordpress.org/Child_Themes#Referencing_.2F_Including_Files_in_Your_Child_Theme
Let me know if you need further assistance.
Regards,
JordanApril 14, 2016 at 4:03 pm #614048Yes, I need )
May I ask you while you are giving support for paid product to provide me with ready to use code but not the reference to DIY guide?April 14, 2016 at 5:17 pm #614125By the way, adding
require_once( get_stylesheet_directory() . '/includes/admin/register-backend-styles.php' );
to child’s function.php (that was the solution offered?) does nothing./includes/admin/register-backend-styles.php (I have preserved original theme’s name and parth structure) as follows:
'style' => 'background-color:#c3512f;', 'default_font' => 'Open Sans:400,600', 'google_webfont'=> 'Open Sans:400,600', 'color_scheme' => 'Splash Orange', // header 'colorset-header_color-bg' =>'#ffffff', 'colorset-header_color-bg2' =>'#f8f8f8', 'colorset-header_color-primary' =>'#c3512f', 'colorset-header_color-secondary' =>'#88BBC8', 'colorset-header_color-color' =>'#333333', 'colorset-header_color-border' =>'#e1e1e1', 'colorset-header_color-img' =>'', 'colorset-header_color-customimage' =>'', 'colorset-header_color-pos' => 'center center', 'colorset-header_color-repeat' => 'repeat', 'colorset-header_color-attach' => 'scroll', 'colorset-header_color-heading' => '#000000', 'colorset-header_color-meta' => '#808080', // main 'colorset-main_color-bg' =>'#ffffff', 'colorset-main_color-bg2' =>'#fcfcfc', 'colorset-main_color-primary' =>'#c3512f', 'colorset-main_color-secondary' =>'#88BBC8', 'colorset-main_color-color' =>'#666666', 'colorset-main_color-border' =>'#e1e1e1', 'colorset-main_color-img' =>'', 'colorset-main_color-customimage' =>'', 'colorset-main_color-pos' => 'center center', 'colorset-main_color-repeat' => 'repeat', 'colorset-main_color-attach' => 'scroll', 'colorset-main_color-heading' => '#222222', 'colorset-main_color-meta' => '#919191', // alternate 'colorset-alternate_color-bg' =>'#fcfcfc', 'colorset-alternate_color-bg2' =>'#ffffff', 'colorset-alternate_color-primary' =>'#c3512f', 'colorset-alternate_color-secondary' =>'#88BBC8', 'colorset-alternate_color-color' =>'#888888', 'colorset-alternate_color-border' =>'#e1e1e1', 'colorset-alternate_color-img' =>'', 'colorset-alternate_color-customimage' =>'', 'colorset-alternate_color-pos' => 'center center', 'colorset-alternate_color-repeat' => 'repeat', 'colorset-alternate_color-attach' => 'scroll', 'colorset-alternate_color-heading' => '#444444', 'colorset-alternate_color-meta' => '#A0A0A0', // Footer "colorset-footer_color-bg" =>"#222222", "colorset-footer_color-bg2" =>"#333333", "colorset-footer_color-primary" =>"#ffffff", "colorset-footer_color-secondary" =>"#aaaaaa", "colorset-footer_color-color" =>"#dddddd", "colorset-footer_color-border" =>"#444444", "colorset-footer_color-img" => "", "colorset-footer_color-customimage" =>"", "colorset-footer_color-pos" => "top center", "colorset-footer_color-repeat" => "repeat", "colorset-footer_color-attach" => "scroll", 'colorset-footer_color-heading' => '#919191', 'colorset-footer_color-meta' => '#919191', // Socket "colorset-socket_color-bg" =>"#333333", "colorset-socket_color-bg2" =>"#555555", "colorset-socket_color-primary" =>"#ffffff", "colorset-socket_color-secondary" =>"#aaaaaa", "colorset-socket_color-color" =>"#eeeeee", "colorset-socket_color-border" =>"#444444", "colorset-socket_color-img" =>"", "colorset-socket_color-customimage" =>"", "colorset-socket_color-pos" => "top center", "colorset-socket_color-repeat" => "repeat", "colorset-socket_color-attach" => "scroll", 'colorset-socket_color-heading' => '#ffffff', 'colorset-socket_color-meta' => '#999999', //body bg 'color-body_style'=>'stretched', 'color-body_color'=>'#333333', 'color-body_attach'=>'scroll', 'color-body_repeat'=>'repeat', 'color-body_pos'=>'center center', 'color-body_img'=>'', 'color-body_customimage' =>'', ); $default_primary = "#719430"; $default_highlight = "#83a83d"; $default_background = "#f8f8f8"; $special_border = "#e1e1e1"; $styles = apply_filters( 'avf_skin_options', $styles );
It is actually Splash Orange without any modifications.
- This reply was modified 8 years, 8 months ago by kacharava.
April 15, 2016 at 2:44 pm #614854Anyone here?
April 18, 2016 at 11:28 am #616279Hey!
There’s a filter named
avf_skin_options
which you can use to add/modify current color schemes, you can add something like this at the very end of your theme / child theme functions.php file:add_filter('avf_skin_options', 'my_custom_added_style_function'); function my_custom_added_style_function($styles = "") { $styles["Custom Name"] = array( 'style'=>'background-color:#000000;', 'default_font' => 'Open Sans:400,600', 'google_webfont' => 'Open Sans:400,600', 'color_scheme' =>'Custom Name' /* Paste all the options of an already created scheme here */ ); return $styles; }
Cheers!
JosueApril 18, 2016 at 11:40 am #616299Modifying child theme this way will finally make its functions.php extremely huge and hard to deal with. I’m looking for a way that allows just load child’s register-backend-styles.php for child theme.
April 18, 2016 at 11:57 am #616313Not possible, if you’re concerned about the file length you could create another .php file in your child theme directory an reference it from functions.php:
include('custom-styles.php');
Regards,
JosueApril 18, 2016 at 11:58 am #616315Will this disable the styles provided with Enfold?
April 18, 2016 at 12:02 pm #616321No, unless you name the scheme name (‘Custom Name’) with something that’s already registered by Enfold.
Regards,
JosueApril 18, 2016 at 12:08 pm #616329This way makes use of the child theme totally meaningless )
I’ve got my answers, thanks.April 18, 2016 at 12:16 pm #616337It’s quite the opposite, child theme hooks (filters/actions) were purposely designed to allow the user to customize / extend a theme or plugin functionality without modifying its main files.
Best regards,
JosueApril 18, 2016 at 2:41 pm #616523But Enfold allows very little to do through a child theme.
April 20, 2016 at 7:02 am #618011Hi,
There could probably be improvements to the way that works yes, like everything else. But at the present time this is how it works.
Best regards,
RikardApril 20, 2016 at 8:44 am #618065Got it. Thanks. )
No reason to keep this topic open any more.
-
AuthorPosts
- The topic ‘How to replace predefined color schemes with own ones?’ is closed to new replies.