Replace Main Styleheet

Community Forums Forums Design Tips and Tricks Replace Main Styleheet

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  transmitstudio 2 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #71876


    I’m looking for a more elegant way to do this. I like to use the stylesheet from the parent (genesis) theme as the main stylesheet but called from a directory in the child theme. Right now I’m accomplishing this via:

    remove_action('genesis_meta', 'genesis_enqueue_main_stylesheet', 5);
    add_action('genesis_meta', 'xmit_genesis_enqueue_main_stylesheet', 10);
    function xmit_genesis_enqueue_main_stylesheet() {
    	wp_enqueue_style( 'genesis-stylesheet', CHILD_URL . '/css/genesis.css', array(), PARENT_THEME_VERSION );

    I realize the usual way to do this would be:

    add_filter( 'stylesheet_uri', 'xmit_replace_default_style_sheet', 10, 2 );
    function xmit_replace_default_style_sheet() {
            return CHILD_URL . '/css/genesis.css';

    but that returns the child theme version and since I’m using the stylesheet from the parent, I want to know what version of the stylesheet I used (copied from the genesis parent to my child css folder and named genesis.css).

    For context here’s how it looks in the head (note the parent them version for genesis.css and the child theme version for custom.css):

    <link rel="stylesheet" id="genesis-stylesheet-css" href="/wp-content/themes/tower/css/genesis.css?ver=2.0.1" type="text/css" media="all">
    <link rel="stylesheet" id="custom-stylesheet-css" href="/wp-content/themes/tower/css/custom.css?ver=1.0.0" type="text/css" media="all">

    If you’re wondering why I’m even bothering with this it’s simply so that when a new version of Genesis is released I can compare any css revisions to the version I’m using and decide if I want to incorporate them. I don’t touch my genesis.css file; I do all child theme styles in child.css.



    This is how i do it to add a second style sheet

    There’s no need to add the Genesis style sheet in the child theme



    Thanks braddalton. I’m with you on the second style sheet. What I’m doing is replacing the main stylesheet with the Genesis style sheet to use as a base. I know there’s no need to add the Genesis style sheet, it’s just how I like to do it. What I’m looking for is a way to indicate the version but I think what I may do is simply define a Genesis constant and use that. The method I posted would display the parent theme version regardless of whether or not I had updated Genesis or not.

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

You must be logged in to reply to this topic.