You are currently viewing WordPress me oceanwp theme ki child theme kaise bnaye?

WordPress me oceanwp theme ki child theme kaise bnaye?

OceanWP Child Theme Banane ke Steps

Step 1: Child Theme Folder Banao

  • File Manager (Hosting) ya FTP (FileZilla) open karo
  • Ye path open karo: /wp-content/themes/
  • Naya folder banao, naam rakho: oceanwp-child

Step 2: style.css File Banao

oceanwp-child folder ke andar style.css file banao

Usme ye code paste karo:

/*

 Theme Name: OceanWP Child

 Theme URI: https://oceanwp.org/

 Description: OceanWP Child Theme

 Author: Your Name

 Author URI: https://yourwebsite.com

 Template: oceanwp

 Version: 1.0

*/

/* Custom CSS yahan likho */

Step 3: functions.php File Banao

oceanwp-child folder me functions.php file banao

Usme ye code likho:

<?php

function oceanwp_child_enqueue_styles() {

    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );

}

add_action( ‘wp_enqueue_scripts’, ‘oceanwp_child_enqueue_styles’ );

Step 4: Child Theme Activate Karo

WordPress Dashboard → Appearance → Themes

OceanWP Child theme dikhegi

Activate kar do 

Optional (Advanced Use)

Agar tum:

  • header.php edit karna chahte ho
  • footer.php change karna ho
  • single.php customize karna ho

Parent theme se file copy karke oceanwp-child me paste karo aur edit karo.

Leave a Reply