Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #28934

    This thread was the closest I saw: http://www.kriesi.at/support/topic/issue-with-child-theme

    But, my enfold functions.php code seems to be slightly different.

    //register styles

    wp_register_style( 'avia-style' , $child_theme_url."/style.css", array(), '1', 'screen' ); //register default style.css file. only include in childthemes. has no purpose in main theme
    wp_register_style( 'avia-grid' , $template_url."/css/grid.css", array(), '1', 'screen' );
    wp_register_style( 'avia-base' , $template_url."/css/base.css", array(), '1', 'screen' );
    wp_register_style( 'avia-layout', $template_url."/css/layout.css", array(), '1', 'screen' );
    wp_register_style( 'avia-scs', $template_url."/css/shortcodes.css", array(), '1', 'screen' );
    wp_register_style( 'avia-custom', $template_url."/css/custom.css", array(), '1', 'screen' );
    wp_register_style( 'avia-prettyP', $template_url."/js/prettyPhoto/css/prettyPhoto.css", array(), '1', 'screen' );
    wp_register_style( 'avia-media' , $template_url."/js/mediaelement/skin-1/mediaelementplayer.css", array(), '1', 'screen' );

    //register styles

    wp_enqueue_style( 'avia-grid');
    wp_enqueue_style( 'avia-base');
    wp_enqueue_style( 'avia-layout');
    wp_enqueue_style( 'avia-scs');
    wp_enqueue_style( 'avia-prettyP');
    wp_enqueue_style( 'avia-media');

    Which I changed, as an educated guess to:

    //register styles

    wp_register_style( 'avia-grid' , $template_url."/css/grid.css", array(), '1', 'screen' );
    wp_register_style( 'avia-base' , $template_url."/css/base.css", array(), '1', 'screen' );
    wp_register_style( 'avia-layout', $template_url."/css/layout.css", array(), '1', 'screen' );
    wp_register_style( 'avia-scs', $template_url."/css/shortcodes.css", array(), '1', 'screen' );
    wp_register_style( 'avia-custom', $template_url."/css/custom.css", array(), '1', 'screen' );
    wp_register_style( 'avia-prettyP', $template_url."/js/prettyPhoto/css/prettyPhoto.css", array(), '1', 'screen' );
    wp_register_style( 'avia-media' , $template_url."/js/mediaelement/skin-1/mediaelementplayer.css", array(), '1', 'screen' );
    wp_register_style( 'avia-style' , $child_theme_url."/style.css", array(), '1', 'screen' ); //register default style.css file. only include in childthemes. has no purpose in main theme

    //register styles

    wp_enqueue_style( 'avia-grid');
    wp_enqueue_style( 'avia-base');
    wp_enqueue_style( 'avia-layout');
    wp_enqueue_style( 'avia-scs');
    wp_enqueue_style( 'avia-prettyP');
    wp_enqueue_style( 'avia-media');

    Is this effectively the same thing? Just needing to change the order in which the child theme is called? I can’t wait to get rid of all the !important tags.

    Thanks and great theme!

    #139200

    Hi jguerrero01,

    As of Enfold 2.0 you shouldn’t need to modify the functions file to get the child theme style coming at the end. I just did a quick test of it creating a new child theme on my live install and it properly spits out the child theme style.css last.

    Changing the order of wp_register_style doesn’t change the output order. That is determined by the wp_enqueue_style which has the if statement at the end now.

    Regards,

    Devin

    #139201

    Thanks Devin!

    I will try creating a new (copied) child theme, perhaps this was started on an older version or something. Thanks!

    One question, what are the different uses between custom.css and style.css? Do they both accomplish the same thing?

    #139202

    Hi,

    No, they don’t, style.css is the file that tells WordPress the theme name, the author, version, etc. and shouldn’t be edited, on the contrary custom.css is a file that you can edit without affecting the core functionality of the theme.

    Regards,

    Josue

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Child Theme Custom CSS Order’ is closed to new replies.