Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter castlenibill

    (@castlenibill)

    Answer: The best way to do this is to include the PHP_INT_MAX

    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', PHP_INT_MAX );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'parent-style' ) );
    }

    kindly describe in detail about how to create a child theme
    where to paste the above code???

    Thread Starter castlenibill

    (@castlenibill)

    Just read the codex, it’s really helpful
    https://codex.www.ads-software.com/Child_Themes

    Basically you just need to create a folder named themename-child ( replace “themename” with the actual name of the theme, then add “-child” )

    Then put two files functions.php and style.css

    style.css requires a header above so it can read by the theme:
    Put on the first lines of your style.css Change the values as respectively.

    /*
     Theme Name:   Twenty Fifteen Child
     Theme URI:    https://example.com/twenty-fifteen-child/
     Description:  Twenty Fifteen Child Theme
     Author:       John Doe
     Author URI:   https://example.com
     Template:     twentyfifteen
     Version:      1.0.0
     License:      GNU General Public License v2 or later
     License URI:  https://www.gnu.org/licenses/gpl-2.0.html
     Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
     Text Domain:  twenty-fifteen-child
    */

    =================================================================

    The code above as you asked, should be pasted in functions.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to do a child theme?’ is closed to new replies.