Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Child theme for q2a?

+5 votes
asked Oct 20, 2017 in Q2A Core by fara

Is it possible to have child theme in the next versions of q2a? Just like what wordpress do.

 A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme. Child themes are the recommended way of modifying an existing theme

There are a few reasons why you would want to use a child theme:

  • If you modify a theme directly and it is updated, then your modifications may be lost. By using a child theme you will ensure that your modifications are preserved.

Read more here

Q2A version: 1.8

1 Answer

+3 votes
answered Oct 20, 2017 by pupi1985
selected Oct 20, 2017 by fara
Best answer
That exists in Q2A as a layer: http://docs.question2answer.org/plugins/layers

Add your theme changes to a plugin with a layer and they will survive the changes in your theme. The interface is exactly the same as a theme class as it (literally) extends the base theme too.
commented Oct 21, 2017 by fara
It seems that this method doesn't change the css for some elements except when using !important.
commented Oct 21, 2017 by pupi1985
If what you said was correct then all plugins should be styling using "!important" and that is not the case.

That is a CSS issue rather than a "method" issue. Q2A allows you to output CSS then you need to output and style the CSS properly.