• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Set custom stylesheet to override styles.css

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Set custom stylesheet to override styles.css

This topic is: not resolved

Tagged: css, restored316-market, stylesheet

  • This topic has 5 replies, 2 voices, and was last updated 8 years, 10 months ago by Victor Font.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • May 23, 2017 at 3:49 am #206855
    Saqib Ali
    Member

    I've enqueued a custom stylesheet into my functions.php folder

    How would you go about making this custom stylesheet more prominent because some the style.css stylesheet is not being overridden by some changes I've made in the custom.css stylesheet.

    http://development site
    May 23, 2017 at 4:10 am #206856
    Victor Font
    Moderator

    The enqueue function has a parameter for priority. Priority determines the load order of style sheets. The higher the priority, the later in the process the style sheet loads. With CSS, the last style sheet to load has the priority in the browser. So, in essence, you have to give the custom style sheet a higher priority than the theme style sheet. This should point you in the right direction: https://victorfont.com/change-genesis-child-theme-style-sheet-load-order/


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 23, 2017 at 6:20 am #206869
    Saqib Ali
    Member

    Thank you @victorfont I've updated the functions.php file and have given styles.css a higher priority, however, when I tried to give an even higher priority for the custom stylesheet, the page has spat out an error on the top.

    
    //* Loads Responsive Menu, Google Fonts, Icons, and other scripts
    add_action( 'wp_enqueue_scripts', 'market_enqueue_scripts' );
    function market_enqueue_scripts() {
    
    	wp_enqueue_style( 'google-font', '//fonts.googleapis.com/css?family=Gentium+Basic:400,400italic|Arimo:400,400italic|IM+Fell+English:400,400italic|EB+Garamond|Homemade+Apple', array() );
    	wp_enqueue_style( 'ionicons', '//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css', array(), CHILD_THEME_VERSION );
    	wp_enqueue_style( 'custom', get_stylesheet_directory_uri() . '/custom.css' );
    	wp_enqueue_script( 'global-script', get_bloginfo( 'stylesheet_directory' ) . '/js/global.js', array( 'jquery' ), '1.0.0' );
    	wp_enqueue_script( 'localScroll', get_stylesheet_directory_uri() . '/js/jquery.localScroll.min.js', array( 'scrollTo' ), '1.2.8b', true );
    	wp_enqueue_script( 'scrollTo', get_stylesheet_directory_uri() . '/js/jquery.scrollTo.min.js', array( 'jquery' ), '1.4.5-beta', true );
    	wp_enqueue_script( 'market-fadeup-script', get_stylesheet_directory_uri() . '/js/fadeup.js', array( 'jquery' ), '1.0.0', true );
    	wp_enqueue_script( 'match-height', get_stylesheet_directory_uri() . '/js/jquery.matchHeight-min.js', array( 'jquery' ), '1.0.0', true );
    	wp_enqueue_script( 'match-height-init', get_stylesheet_directory_uri() . '/js/matchheight-init.js', array( 'match-height' ), '1.0.0', true );
    }
    
    //* Load main style sheet after WooCommerce */
    remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
    add_action( 'wp_enqueue_scripts', 'genesis_enqueue_main_stylesheet', 30 ); //change load priority
    
    add_action( 'wp_enqueue_scripts', 'custom', 40 ); //custom stylesheet
    
    May 23, 2017 at 6:22 am #206871
    Saqib Ali
    Member

    Cheers @victorfont I've updated the functions.php file and have given styles.css a higher priority, however, when I tried to give an even higher priority for the custom stylesheet, the page has spat out an error on the top.

    
    //* Loads Responsive Menu, Google Fonts, Icons, and other scripts
    add_action( 'wp_enqueue_scripts', 'market_enqueue_scripts' );
    function market_enqueue_scripts() {
    
    	wp_enqueue_style( 'google-font', '//fonts.googleapis.com/css?family=Gentium+Basic:400,400italic|Arimo:400,400italic|IM+Fell+English:400,400italic|EB+Garamond|Homemade+Apple', array() );
    	wp_enqueue_style( 'ionicons', '//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css', array(), CHILD_THEME_VERSION );
    	wp_enqueue_style( 'custom', get_stylesheet_directory_uri() . '/custom.css' );
    	wp_enqueue_script( 'global-script', get_bloginfo( 'stylesheet_directory' ) . '/js/global.js', array( 'jquery' ), '1.0.0' );
    	wp_enqueue_script( 'localScroll', get_stylesheet_directory_uri() . '/js/jquery.localScroll.min.js', array( 'scrollTo' ), '1.2.8b', true );
    	wp_enqueue_script( 'scrollTo', get_stylesheet_directory_uri() . '/js/jquery.scrollTo.min.js', array( 'jquery' ), '1.4.5-beta', true );
    	wp_enqueue_script( 'market-fadeup-script', get_stylesheet_directory_uri() . '/js/fadeup.js', array( 'jquery' ), '1.0.0', true );
    	wp_enqueue_script( 'match-height', get_stylesheet_directory_uri() . '/js/jquery.matchHeight-min.js', array( 'jquery' ), '1.0.0', true );
    	wp_enqueue_script( 'match-height-init', get_stylesheet_directory_uri() . '/js/matchheight-init.js', array( 'match-height' ), '1.0.0', true );
    }
    
    //* Load main style sheet after WooCommerce */
    remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
    add_action( 'wp_enqueue_scripts', 'genesis_enqueue_main_stylesheet', 30 ); //change load priority
    
    add_action( 'wp_enqueue_scripts', 'custom', 40 ); //custom stylesheet
    
    May 23, 2017 at 9:23 am #206878
    Victor Font
    Moderator

    wp_enqueue_scripts requires a function as its argument. That's why you're receiving the error. https://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts

    You are loading custom in add_action( 'wp_enqueue_scripts', 'market_enqueue_scripts';. Remove custom from that function and create a new function:

    function load_custom_styles() {
    	wp_enqueue_style( 'custom', get_stylesheet_directory_uri() . '/custom.css' );
    }
    add_action( 'wp_enqueue_scripts', 'load_custom_styles', 40 ); //custom stylesheet
    

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 24, 2017 at 2:04 pm #206940
    Victor Font
    Moderator

    You're last post didn't come through. If it had more than two links, it was spammed.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble