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
- Check if a script/style was enqueued/registered
- How to load Widget javascript + css files only if used?
- 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!
- Do all files in child theme override the parent?
- Trying to load different syles for 404.php page
- How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
- Under heavy cache conditions, updating the parent theme don’t reflect changes with child theme enabled
- Remove specific CSS and JS from the head
- Enqueue more than two CSS styles in a child theme functions.php
- Enqueue script o style only if a template part is loaded
- Child themes & updates?
- Where to put custom PHP files in a child theme?
- Why is “get_template_directory_uri” pointing to child theme?
- How to make child theme ignore a parent themes template
- Conditionally load child themes
- How to avoid loading same script twice?
- bbpress change the word forum, topic, reply in the forum to another word I choose
- functions.php not hooking up with style.css
- Enqueueing scripts and styles multiple CPTS
- Parent theme CSS overriding child CSS rules
- Child theme works in local environment but is not working on remote
- Tesseract child theme loads slow [closed]
- Order of stylesheets in child theme
- Only let plugin add actions to wp_head & wp_footer on single posts
- Adding a title below the logo
- Can´t access child theme´s scripts dependencies found in parent
- How to call a static function in add_action() inside another static function?
- How Child Themes Directory works for plugins?
- Enqueuing a script before anything else
- Child Theme CSS not showing at all
- linking stylesheets and scripts with functions.php
- Plugin Development – Class Constructor Not Firing wp_enqueue_style action hook
- functions.php – inject inline css from file
- how to load css and js based on post template
- Child theme not importing parent styles
- Updating my WordPress.org version will cause my site to break… What can I do to avoid this?
- Page not found when trying to link to files in child theme directory
- template_include doesn’t work with child theme
- How to fix error message to edit sidebar widget text on a livesite childtheme?
- Bootstrap Integtration
- WordPress core jquery version file not loaded?
- How to enqueue a script on a specific URL that contains multiple parts
- Child Theme Can’t Find Parent In a Folder
- Problems with child theme
- Installation directory for WordPress and child theme
- How to include only modifications in child theme?
- Child Theme > Template
- How can I print out a single stylesheet or javascript link?
- Browser stacks different versions of style.css
- wp_enqueue_style conflict when using in different action hooks