There’s a simple way to test:
- add
wp_die('it works');
tofunctions.php
, if you seeit works
on every page, then it’s worked - add a silly CSS rule to
style.css
, e.g.body { border: 100px solid pink; }
, if your pages now have a 100 pixel pink border then your stylesheet is working
If it works, then you did it correctly, if you didn’t do it the correct way, it wouldn’t work.
Otherwise, the only thing’s I’d note are that:
- it’s
functions.php
notfunction.php
- avoid closing PHP tags in functions.php, PHP will auto-add them if needed, and it prevents a common mistake with whitespace after the tag
my_theme
is a very generic prefix, you should pick something more unique
Related Posts:
- Enqueue styles properly in a child theme and stylesheets location
- how to fix loading scripts in child theme?
- How to override JavaScript files in child theme?
- How do I dequeue a parent theme’s CSS file?
- Issues enqueueing parent & child theme stylesheets with revised Codex method
- Why is the Child Theme Stylesheet Not Loading?
- Give priority to child theme stylesheet
- Get parent theme version
- How to use parent theme’s enqueue methods
- How to maintain wp_enqueue_style dependencies set in parent theme style enqueuing
- How to dequeue / deregister parent theme style
- Style.css in child theme is loaded before Bootstrap
- How are updates to the style.css file in child theme recognized?
- How do I set up a child-theme without using @import
- Find a Parent Theme’s stylesheet $handle when it registers a stylesheet
- Dequeue only stylesheets but not inline style added using wp_add_inline_style
- Enqueue stylesheets if parent theme has more than one .css file
- ERROR MESSAGE: Missing index.php—Child Theme
- Priority loading file css in child theme
- WP .js script file not loading
- Child theme style repeated
- wp_add_inline_script not adding when script_loader_tag filtered
- How to NOT call Font Awesome or font icons in WordPress
- @font-face broken in child theme
- Prevent a base themes css file from loading
- How to enqueue scripts in order of Head section
- Cannot dequeue script in child theme
- WordPress Child theme’s css not loading
- Confused about how to use wp_enqueue_style
- Child theme stylesheet not always overriding “index”
- Child style loads before all parent styles
- Enqueue custom css file on specific page
- javascript not being enqueued correctly
- How can I get this child theme stylesheet to properly load? Or if it is correct, why doesn’t my child theme appearance match the parent?
- How to make child theme in wordpress with wp_enqueue_style ? Using Enough Theme
- wp_enqueue wont work on some files?
- Can only override parent theme styling with ‘!important’ in child style.css
- Can’t seem to get javascript code working from child theme
- Why does using wp_register_style without wp_enqueue load and print CSS tags in the front-end?
- Add custom css file after plugin css with WordPress Child Theme functions.php
- Child theme is not rendering parent and own javascripts (but css loaded properly, js not)
- Remove Stylesheet by URL that has not been enqueued
- How to enqueue multiple style sheets into my child theme in wordpress (oceanwp)
- Enqueuing multiple stylesheets with a child theme
- using a child theme, after enqueing my js file it is loading before jquery
- Why won’t my Custom CSS Load
- custom template – override plugin template in child theme – issue with scripts
- WordPress | enqueue_scripts in a child’s theme returns error
- How to create my own style.css file in an wordpress child-theme
- Can’t disable child theme style
- How do I Enqueue styles/scripts on Certain /wp-admin Pages?
- Where is the right place to register/enqueue scripts & styles
- Conditionally Loading JavaScript/CSS for Shortcodes
- Check if a script/style was enqueued/registered
- wp enqueue style on specific page templates
- Versioning @import of parent theme’s style.css
- How to add code to Header.php in a child theme?
- Why does my child theme CSS get called twice?
- How to load css in the footer [duplicate]
- How can I get a list of all enqueued scripts and styles?
- Load CSS/Javascript in frontend conditionally if block is used
- How to properly dequeue scripts and styles in child theme?
- How do themes provide support for child themes?
- Prevent Version URL Parameter (?ver=X.X.X) on Enqueued Styles & Scripts
- Attributing a version number to a child theme’s main stylesheet
- Preserving theme settings in child theme
- Is it possible to make grandchild themes?
- How to load Widget javascript + css files only if used?
- how do I queue my Child stylesheet/s *after* every Parent stylesheet/statement?
- How to load scripts/styles specific for a page
- How to cache bust a child theme style.css
- How can I de-register ALL styles all at once? And same with Javascript?
- How to add stylesheets only to pages with specific shortcode?
- Is a text-domain necessary for a child theme
- How to modify single.php in a child theme?
- Cannot get Child Theme to load latest version of style.css
- @package & @subpackage: how to use with child themes
- How to override function in child theme
- Hiding Parent Theme
- Enqueue custom font file with rel=”preload”
- How do I force wp_enqueue_scripts to load at the END of ?
- Load js/css files only on specific admin UI pages
- Get list of scripts / styles and show file which enqueued them
- get_stylesheet_directory() vs get_template_directory() for child theme
- Theme Customization API and child themes
- Why I can’t add a CSS style in this WordPress theme?
- Removing specific style from wp_head
- How to dequeue / deregister any theme styles and scripts
- get_parent_theme_file_path vs. get_template_directory
- Git vs Child Theme
- Child theme does not overwrite parent themes style.css
- how to call files in child theme?
- Get Parent Theme Author Name
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- Notice that the wp_enqueue_style is not being called correctly!
- Hyphens vs. periods in the script slug in wp_register_script?
- Optimal approach for replacing the 8 header images in a child theme?
- How can I dequeue a Plugin Stylesheet?
- Use wp_enqueue_scripts, not wp_print_styles?
- jquery script not enqueued in child theme