You will need to look at the original widgets.php file and ensure that all the relevant CSS classes are present in the selectors.
Obviously CSS is selector dependent and significantly changing the selectors will cause the CSS not to work.
I have tried to edit the original widgets.php and it shows my changes, after I have hit “save changes” in the “Category Colors Settings”.
I reverted to the original widgets.php, hitted “save changes” again and it looks like before. Then I made a copy of it and moved it to /child-theme/teccc/widgets.php. Then I changed it, like I did before. and then again hitting “save changes”… And nothing changed.
The thing is, im not sure if it should be placed in root of of the teccc folder of my child theme. I have also tried with teccc/src/Category_Colors/ but still didn’t seems to work.
I believe it needs to be placed in the same folder structure inside of the /child-theme/tribe-events/
folder.
https://github.com/afragen/the-events-calendar-category-colors/wiki/Setting-up-template-overrides
Please remember, this is for overriding templates of this plugin. Any template overrides of The Events Calendar need to be done according to their directions.
ah yes, sorry. I did put it in
/child-theme/tribe-events/teccc/Widgets.php
Now i have also tried a few other solutions, without much luck so far sadly.
/child-theme/tribe-events/teccc/Widgets.php
/child-theme/tribe-events/teccc/src/Category_Colors/Widgets.php
/child-theme/tribe-events/teccc/Category_Colors/Widgets.php
That was the 3 options i have tested wihtout much luck so far
What is the normal path of the template you are trying to override?
OK so you want to override the built in Widgets.php
class.
To do that you will need to create a new class. The new class would likely be something like the following. You could add the new class to your child theme and remember to load the class in your functions.php
.
<?php
class My_Widgets {
public static function add_widget_link_css( $slug ) {
$css = array();
$css[] = '';
$css = implode( "\n", $css );
echo $css;
}
public static function add_widget_background_css( $slug ) {
$css = array();
$css[] = '';
$css = implode( "\n", $css );
echo $css;
}
}
You would also need to create a temple override of category.css.php
. The lines in category.css.php
that reference <?php Widgets:: ... ?>
would need to be changed to reference <?php \My_Widgets:: ... ?>
The template override would be located in <child-theme>/tribe-events/teccc/category.css.php
Thanks! That pushed me in the right direction and it is now working.
Excellent! If you have the time could you leave a review? Thnanks.