Support » Theme: Asteria Lite » Child Theme Issues

  • Resolved ade11



    First off, great theme, you are clearly a talented developer.

    However, reading around, many people seem to be having issues making a child theme from Asteria-Lite. Please can we suggest you make one yourself to appreciate the problems people are experiencing here? e.g. as per instructions in

    The problems seem superficially easy to fix?

    Firstly, the child stylesheet is never being loaded. In functions.php you load style.css thus;

    wp_enqueue_style( 'asteria-style', get_template_directory_uri().'/style.css');

    In fact, you should probably do it like this;

    wp_enqueue_style( 'asteria-style', get_stylesheet_uri() );

    My understanding is that the get_template…. functions load ONLY from the template directory, the get_stylesheet… functions load from the child theme directory or the template directory if we’re not using a child. So would work in either case.

    Secondly, the solution you are suggesting on some threads when people point out their styles aren’t being loaded, of using the custom CSS option, this has a slight problem also – it pokes the styles into the header too early, i.e. BEFORE the main stylesheet, so the main stylesheet will generally just reset everything to how it was. To override styles, it would be better putting this block of CSS after the main stylesheet? Otherwise we need to use a lot of !important tags for each of the custom styles we define.

    So instead of in header.php, having the call get_template_part('style') above wp_head, either put it below (not good practice I hear) or else use a late hook on wp_head e.g.

    function poke_css() {
       global $asteria;
       if ( ! empty ( $asteria['custom-css'] ) ) {
         echo '<style>'.$asteria['custom-css'].'</style>';

    The other blocks of CSS in there could be treated in the same way, to make it neat. Woo-commerce and others could perhaps be made options, we do seem to load quite a lot of support for this and not everyone uses woo-commerce?

    Anyhows, hope this helps to make your theme even better, and once again, great job on the theme so far!


Viewing 1 replies (of 1 total)
  • Theme Author Towfiq I.


    ade Excellent point on enqueing the stylesheet. spot on. I am not sure why I used get_template_directory_uri/style.css.. :/

    and about the suggestion of loading the style.php, I will have to make some tests and see if I can make this work.

    Thanks for your excellent constructive feedback. If you find any other bug please let me know. 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Child Theme Issues’ is closed to new replies.