The first parameter of wp_enqueue_style
and wp_register_style
is used to register the stylesheet for later use. So, you can register it early and later call it just specifying it’s first parameter.
In this case you are registering and enqueueing the stylesheet td-theme-child
, which file is style.css
. After that, if the conditional passes, you are registering and enqueueing the stylesheet td-theme-child
, which file is style2.css
… but, WP already sent the td-theme-child
, so the style2.css
will never hit the browser.
So, in short, just change the first parameter of your style2.css enqueue line:
wp_enqueue_style( 'td-theme-child2', get_stylesheet_directory_uri().'/style2.css'. 'c', 'all' );
Related Posts:
- Child Theme Not Overriding Parent Theme
- Please Explain the Importing Process of Multiple Stylesheets for Child Themes
- Not all CSS elements transferring via parent to child?
- Parent theme styles overriding child theme CSS [closed]
- get_template_directory_uri() links to child theme not parent
- Setting Up Child Theme To Take Priority
- Child Theme not loading multiple stylesheets
- Preventing PHP Execution in Parent Theme
- Functions.php in child theme that loads CSS file breaks website
- How do I make my child theme’s CSS update when I save it?
- get_template_directory_uri pointing to parent theme not child theme
- Include files in child theme functions file
- functions.php inject inline css
- One Child Functions.php for Multiple Child Themes
- Removing custom background and header feature in child theme
- How do I create a new WP admin color scheme?
- How to override function in functions.php of parent theme?
- Implementing DNS Prefetching with WordPress
- override parent theme configuration in child functions.php
- Child theme – overriding add_image_size by a child theme [duplicate]
- Add attribute to link tag that’s generated through wp_register_style?
- How to override functions.php in child theme?
- Function in Child Theme not overriding Parent Theme function [duplicate]
- Simple/basic use of get_current_screen
- I created a child theme and it doesn’t work for some of the css files
- Is it possible to be more page/post specific with admin_enqueue_script?
- Enqueue styles after a plugin
- How to override enqueued styles using a child theme
- How to store / access files in child theme folder
- Make “sidebar template” the default template for new pages
- override parent theme configuration in child functions.php
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- How do I get a child theme to load scripts from the parent theme?
- Add class or ID to any WordPress function
- how to edit functions.php in a child theme
- Best practice when altering a parent theme function inside a child theme?
- Avoid loading css from parent theme
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- How to style options page in dashboard?
- Overwriting Parent Theme’s Image Sizes
- Problem only while using require_once() within functions.php
- Twentyten Child Theme: header images display messed up in admin panel
- WordPress Menuing Question :focus
- Reuse variable in hook callback
- Automatically include all php files in a child theme directory
- Override the function twentytwelve_scripts_styles in a child theme
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- How to load parent theme template parts in child theme
- Custom styles.css sheet for visual editor
- Running script based on Category
- Is my code correct to enqueue CSS on a specific page?
- Split Media Queries in different files!
- How to edit classes in body tag?
- problem loading stylesheets to wp_head dynamically
- Randomizing wp_tag_cloud() in child theme
- Where do I go to edit this area? [closed]
- How to insert class in each list of categories?
- Theme JS is available but theme CSS isn’t
- Proper Way to Load stylesheet on Condition
- Default Nav Highlight
- Unable to point the child theme directory even using get_stylesheet_directory()
- How to edit/replace Parent functions.php function in Child Theme to add “Walker” class
- Child theme function.php causes fatal error
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- Solution dealing with Child Theme / Parent theme functions
- remove/hide wp-editor
- Removing parent theme CSS without editing parent theme
- How to override this theme function in child theme
- get_template_directory() – references parent theme directory
- Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy
- Looking for Functions File that doesn’t Exist
- Can’t load assets
- Adding a schema code to one specific page using functions.php file
- Add Javascript code to functions.php childtheme
- CSS style and app.js not loading
- Child theme, how to cut the functions.php file into several classes?
- How do I make a custom “Read More Blogs” button for my blog page
- function class doesnt work
- Replace theme function
- how to remove a tag in the_category function
- CSS disabled after getting rid of emoji
- How do I create a child theme from PowerMag theme
- How to add styles in existing function?
- How would I correctly implement a new if statement in a child functions file?
- How do I dequeue a Stylesheet, stored in an ‘Assets’ folder?
- Correct way of Enqueue self hosted fonts in sass project
- Including admin-options.php file in Child Themes
- Modified functions.php in Magazine Pro theme of Genesis. 500 error
- How to automatically add custom classes to headings in content area
- uninstall a theme programmaticlly
- Update add_image_size
- Load a Child Theme’s style.css just before the closing tag
- Is it possible to change parameters of Parent theme function in the Child theme?
- unregister_sidebar in child theme not working
- Unregistering custom tinymce plugin?
- functions.php / replacing div’s with new ones?
- Should I use `get_stylesheet_uri()` or `get_template_directory_uri()` when calling my CSS Stylesheet?
- Child Theme not working – CSS gone
- Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?