Created
          August 9, 2025 12:44 
        
      - 
      
- 
        Save mdmoinulhossain/e5d840a4c72fb92cd1f0ff6e50c5c08d to your computer and use it in GitHub Desktop. 
    Child Theme function.php example
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| function my_child_theme_enqueue_styles() { | |
| // Enqueue the parent theme stylesheet | |
| $parent_style = 'parent-style'; | |
| wp_enqueue_style($parent_style, get_template_directory_uri() . '/style.css'); | |
| // Enqueue the child theme stylesheet | |
| 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_child_theme_enqueue_styles'); | |
| ?> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment