• Katharsisdrill

    (@katharsisdrill000)


    I’ve had some troubles with custom tables in twenty twenty. No matter what I did the inline css overruled my own css in a child theme. and made the border grey (I wanted it transparent or the colour of the background).

    It is the line

    pre,fieldset,input,textarea,table,table *,hr { border-color: #d3d3d3; }

    where the last “table *” blocks everything.

    My workaround has been to go to the functions.php and change twentytwenty_get_elements_array() by renaming table * to something else, but it’s not really an elegant solution, and it has to be done every time I update twenty twenty.

Viewing 8 replies - 1 through 8 (of 8 total)
  • If you put your line of code in your child theme’s functions, that should keep it safe from updates.

    Thread Starter Katharsisdrill

    (@katharsisdrill000)

    Yes, I tried, but I am to dim to do it right.. it crashes the site when I try to move the whole (rather large and vital) function giving me a fatal error: Cannot redeclare twentytwenty_get_elements_array(). And I am not sure I can write the php that is needed.

    Don’t move the function.php. That has to remain where it is.

    If you have set up your child theme correctly, there should be a function.php in the child directory. Just add your code in that file.

    Thread Starter Katharsisdrill

    (@katharsisdrill000)

    Sorry I didn’t express myself clearly. I copied the function from the parent function.php to my child theme function.php, but somehow the whole function can’t be redeclared.

    I’m not a PHP Wizard so I’m a bit unsure.

    You don’t need to copy anything from the parent theme to the child. All you need to do is add your function to the empty (presumably) function.php file. The child takes on all the functions from the parent and transforms as you add your own functions and styles.

    Thread Starter Katharsisdrill

    (@katharsisdrill000)

    Yes, that is what I have tried, but after reading a bit ( https://mhthemes.com/support/knb/overriding-parent-theme-functions-child-theme-tutorial )it seems that WordPress is also loading the parent theme functions, only after it has loaded the child theme functions. As I am changing the variables it runs the same function again and tries to redeclare all those “element” arrays, thus giving me the error.

    I wish I could find somewhere less important in the code than the element array to stick in my knife, but I haven’t been able to even find where it get the grey colour value (#3d3d3d) for the table. Maybe it is in the wordpress code?

    Someone with more experience than I could help. I have only used Child Themes in a prosaic and simple manner. I thought the loading was the other way around — certainly that is the way with styles.

    Perhaps giving the function a unique name might do the trick.

    Another idea might be to use a different page template with all the elements you need in place. Rather than using the original elements, you could use the ones you want and the associated styles.

    Thread Starter Katharsisdrill

    (@katharsisdrill000)

    Yes, I’d hoped that it was only necessary to do CSS corrections, but table * blocks any part of the table hierachy no matter where you use a table. When it is just table that is assigned a colour you can always us <tr> or <td> and get your result.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Inline “table *” property blocks custom css’ is closed to new replies.