How to create a child theme in wordpress ?

1)Under wp-contents ->themes -> create new folder sometheme 

2)under sometheme folder create style.css 

add below lines

/*
 Theme Name:   Nadi plumbing
 Theme URI:    http://example.com/my-child-theme
 Description:  A custom child theme for the Twenty Twenty-One theme
 Author:       Invitra
 Author URI:   http://example.com
 Template:     twentytwenty
 Version:      1.0.0
*/

3) define functions.php  to interact between wordpress and database , define functions here 

4) header.php - the of html from starting html tag to header tag 

5) footer.php   a html code from footer start tag to html end tag

6) front-page.php : the content that you want to add to home page 

<?php get_header(); ?>

<!--/main content  -->

<?php get_footer(); ?>


7)page.php :  the pages design for other pages 

<?php
/*
Template Name: Custom Page Template
Template Post Type: page
 */

get_header(); // Include the header.php file
?>
        <?php
while (have_posts()):
    the_post();

    // the_content();
    get_template_part('content');

    if (comments_open() || get_comments_number()):
        comments_template();
    endif;
endwhile;
?>

<?php get_footer();?>




Comments

Popular posts from this blog

How to create sliders banners custom code in wordpress ?