• 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

How can I add custom .css file and .js file to my theme ?

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 › How can I add custom .css file and .js file to my theme ?

This topic is: not resolved

Tagged: wp_enqueue_script, wp_enqueue_style

  • This topic has 4 replies, 3 voices, and was last updated 5 years ago by Brad Dalton.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • July 3, 2020 at 10:08 am #499867
    Stela
    Participant

    Hello there,
    How can I add custom .css file and .js file to my theme?
    I'd like to add this with code, not through plugins in the WP backend.

    Thank you

    July 3, 2020 at 4:32 pm #499888
    AnitaC
    Keymaster

    Create a custom.css file and js file and enqueue them in the functions.php file. Save the custom.css file in the theme folder and save the js file in the js folder.


    Need help with customization or troubleshooting? Reach out to me.

    July 3, 2020 at 10:02 pm #499912
    Brad Dalton
    Participant

    Take a look in the functions.php file in one of the StudioPress child themes and you'll find some PHP code like this :

    add_action( 'wp_enqueue_scripts', 'custom_script_styles' );
    function custom_script_styles() {
    
    wp_enqueue_script( 'custom-scripts', get_stylesheet_directory_uri() . '/js/custom.js', array( 'jquery' ), CHILD_THEME_VERSION, true );
    
    wp_enqueue_style( 'custom-styles', get_stylesheet_directory_uri() . '/css/style-custom.css' );
    
    }
    

    Tutorials for StudioPress Themes.

    July 4, 2020 at 1:35 pm #499953
    Stela
    Participant

    Hi Brad,
    Thank you for your help!

    July 4, 2020 at 6:48 pm #499957
    Brad Dalton
    Participant

    You're welcome Stela.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 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

© 2025 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