You posted in a comment that the current theme uses the following code in its header.php
<link rel="stylesheet" href="https://wordpress.stackexchange.com/questions/318269/<?php bloginfo("template_url'); ?>/style.css" type="text/css" media="screen"/>
This is not WordPress best practice and hence the linked tutorials fail you.
How to go on from this?
Copy header.php from parent to child theme, remove the line containing style.css, then you can place the following code in your child theme’s functions.php:
function my_theme_enqueue_styles() {
wp_register_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( 'parent-style' ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
Related Posts:
- Override get_template_directory() in child theme?
- Childs PHP files not overwriting Parent’s PHP files
- why is translation not working on theme?
- Is it possible to disable a function of a parent theme?
- How to override an unpluggable parent theme function?
- How do I remove a require_once admin panel from the parent theme from the child theme functions.php?
- is there a simple way to list every templates / php files used to generate a specific page?
- Copyright info change in Theme Child PHP
- Add footer.php to WordPress child theme
- Update Custom Field on Imported Post Creation
- Setting up the child theme so as to enable right-to-left WordPress?
- Insert post without actions/hooks
- How to override a non pluggable and non hookable function in a WordPress parent theme?
- Understanding WordPress child theme custom JS loading
- Import 10,000 Users into WordPress WITH a specific ID for each user
- Understanding child theme functions.php
- Overriding a theme redux file in child theme
- Want to create Child theme, but already edited Parent theme css files and some php files
- child theme inherticance and php autoload
- How do I target the child theme with get_bloginfo();?
- Deregister and Dequeue Stylesheets From a Plugin and Enqueue a Child’s Stylesheet/s
- Adding tawk.to code just before body tag on functions.php file
- phpMyAdmin displays error when importing database
- Can’t extend some core classes
- WordPress child theme fails to override parent navigation menu in /inc/structure/header.php
- Where to edit the template that is generating the code for dynamic_sidebar left-sidebar in the Understrap theme? [closed]
- Parent theme CSS overriding child CSS rules
- How to style options page in dashboard?
- How can I get the total number of installed importers?
- Replace part of a parent-theme customizer in the child-theme
- two columns of posts on homepage, one of them “favorites”
- How to edit php files in Child Theme?
- WordPress Child Themes
- Custom Background by Page IDs
- Copyright info change – Corporate Plus Theme PHP [closed]
- Started getting warning message following host’s PHP upgrade
- How to set the WordPress logo programmatically with PHP
- WordPress import media error
- Why does the Woocommerce grouped template prints the unpublished products?
- How to edit HTML of my website on WordPress? [closed]
- Divi change project category slug
- How to specify the path for require_once in a child theme?
- Warning: printf(): Too few arguments in helpers.php file
- What’s a good way to allow overwriting files within a child theme if I want the same folder structure?
- WordPress filter load_textdomain_mofile not working inside a child theme’s functions.php but works form inside a plugin
- How do I check or test a WordPress Auto Year Change Script?
- Use custom template on custom post type
- Removing “Powered by” footer using child theme PHP [closed]
- Overide Variable in Child Theme
- child parent styles enqueue order
- Creating a child theme after numerous edits to parent theme
- using wp enqueue style to create a CSS file specifically for a page template
- How to style injected code in header section?
- Where should I copy a PHP file from wp-includes to, in order to override it in my child theme?
- Child Theme’s Read More Text
- phpMyAdmin error #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- Need advice on theme customizer and child themes
- Conditionally remove comments and post meta in functions.php
- How to edit background color of only one sidebar?
- Inline CSS header style priority function.php Child (no enqueing I think)
- Why would the child theme load in the Customize preview, but not on the site itself?
- Proper way to remove html code on child theme
- Child-Theme Category View with modified permalinks (%category% removed)
- remove_action from parent theme using child theme functions.php
- File from parent theme imported to child theme doesn’t work – any ideas?
- How to change this ajax function to submit to the default wordpress content area instead of the custom field ‘seller notes’?
- Child theme overirde template-tags in a theme built on underscores in inc/template-tags
- PHP “warning include_once(): Failed to open stream” Simple HTML DOM in WordPress Child Theme
- AJAX numerical pagination problem in TwentyFifteen-child theme
- Create “blank” admin page without having admin-bar/admin-menu for faster load
- How to change the structure/order of sections in a WordPress theme? [closed]
- How to edit button permalink inside function.php using a child theme?
- How to locate parent theme functions and add functions to my wordpress child theme?
- How to let mobile navigation menu close when link is clicked?
- how to add functions to my function.php using a child theme?
- Modifying child theme’s header
- How to Change Site Elements based on referring URL
- WordPress files break if I edit them, but adding a closing PHP tag fixes it
- Add the shortcodes from the enfold theme to the other theme
- If i use a child theme to add new code blocks to header.php, how does it get inserted in the right place in parent’s header.php?
- WordPress child theme, creating a custom php template page
- How to override html codes in wordpress?
- random woocommerce categories are not showing when count enabled?
- Add Text Area To Child Theme’s Home Page
- Local WordPress from Git repo, where to set document root?
- Adding custom PHP to existing loop in Genesis
- Pull a div from one WordPress site into another WordPress site
- Where to find the html for WordPress site? [closed]
- Child theme functions.php file change database entries
- Importing demo data in Multisite
- How to remove image on single product and get product to span page?
- Removing get_template_part in child theme
- Modify arguments for parent theme’s `wp_register_style` via child theme
- Child theme not working properly
- If I define a variable in header.php, how do I make it available to templates?
- Child-theme suddenly stopped working [closed]
- Divi – add title to mobile menu button
- Getting invalid user ID error when creating a new user with wp_insert_user
- Creating posts with php-script + csv
- How can I use AJAX in child theme template?