Setup
Setting up a child theme in WordPress ensures that you can make customizations without losing them when the parent theme updates. Here’s a step-by-step guide:
Create a Child Theme Folder
- Connect to your WordPress site via FTP or File Manager in your hosting control panel.
- Navigate to
wp-content/themes/
. - Create a new folder and name it something like
nx-theme-child
.
Create a style.css File
- Inside the child theme folder, create a new file called style.css.
- Add the following code:
/* Theme Name: NX Theme Child Theme URI: https://www.nxcode.gr/nxtheme/demo/ Description: NX Theme Child Theme Author: NXCODE Author URI: https://www.nxcode.gr Template: nx-theme Version: 1.0.0 */
Create a functions.php File
In the same child theme folder, create a functions.php
file. In this file we recommend requiring all files structured for better readablity instead of just adding all code in one place.
require_once 'inc/admin/utility-functions-child.php'; require_once 'inc/admin/redirect-functions-child.php'; require_once 'inc/admin/admin-panel-functions-child.php'; require_once 'inc/front/functions_frontend.php'; require_once 'inc/front/functions_restapi.php'; require_once 'inc/front/functions_shortcodes.php';
Activate the Child Theme
- Go to Appearance > Themes in the WordPress admin panel.
- You should see your new NX Theme Child theme.
- Click Activate.