아스트라 차일드 테마 만들기 1초 완성(Astra Child Theme Generator)

아스트라 차일드 테마 만들기 방법은 아스트라 차일드 테마 생성기를 이용하는 방법이 가장 간편합니다. 아스트라 차일드 테마 생성기는 별도의 플러그인 설치 없이 브라우저에서 클릭 한 번만으로 차일드 테마를 만들어 주는 도구입니다.

아스트라 테마

아스트라 차일드 테마 만들기

아스트라 테마는 사용자 친화적이고 다양한 기능을 제공하는 워드프레스에서 가장 인기 있는 테마입니다. 아스트라에서는 자동으로 차일드 테마를 생성해 주는 편리한 도구를 제공해 주고 있어 별도의 플러그인을 설치하거나 직접 차일드 테마를 만드는 수고를 덜어 주고 있습니다.

아스트라 차일드 테마 생성기를 이용하려면 먼저 아스트라 차일드 테마 생성기 페이지로 이동해 “Generate” 버튼 한 번만 클릭하면 차일드 테마가 완성된 다운로드됩니다.

아스트라 차일드 테마 생성 페이지

“Child Theme Name” 입력란에는 아무것도 입력하지 말고 그대로 “Asrta Child”로 둔 채 “Generate” 버튼을 클릭하면 자동으로 “astra-child.zip”파일이 다운로드됩니다.

아스트라 차일드 테마 설치

차일드 테마를 활성화하려면 부모인 아스트라 테마가 설치되어 있어야 합니다.

차일드 테마 설치는 방금 다운로드한 “astra-child.zip” 파일을 업로드해 설치할 것입니다.

워드프레스 관리자 페이지로 접속해 왼쪽 메뉴에서 “외모”를 선택 후 “새로운 테마 추가”를 클릭합니다.

워드프레스 관리자 페이지

테마 업로드를 클릭 후 “파일 선택” 버튼을 클릭해 다운로드한 “astra-child.zip”을 선택해 업로드합니다. 그리고 “지금 설치” 버튼을 클릭하면 설치가 시작됩니다.

아스트라 차일드 테마 설치

차일드 테마 설치가 완료되면 하단에 “활성화”를 클릭해 설치를 완료합니다.

아스트라 차일드 테마 활성화

또는 테마 페이지로 이동해 설치된 “아스트라 차일드 테마”를 활성화합니다.

아스트라 차일드 테마 활성화

이상으로 아스트라 차일드 테마 생성과 설치 방법을 알아보았습니다.

아스트라 차일드 테마 구성 살펴보기

번외로 아스트라 차일드 테마 구성 파일들을 살펴보겠습니다.

다운로드한 차일드 테마에는 아래와 같이 3개의 파일이 존재합니다. 이 중 ‘style.css’와 ‘functions.php’는 차일드 테마의 필수 구성 요소입니다.

  • style.css
  • functions.php
  • screenshot.jpg

style.css

스타일 시트는 아래와 같이 작성되어 있습니다. 주석에 작성된 구문 중 “Theme Name: Astra Child”와 “Template: astra”는 필수 요소이며 나머지는 삭제하거나 수정할 수 있습니다.

/**
Theme Name: Astra Child
Author: Brainstorm Force
Author URI: http://wpastra.com/about/
Description: Astra is the fastest, fully customizable & beautiful theme suitable for blogs, personal portfolios and business websites. It is very lightweight (less than 50KB on frontend) and offers unparalleled speed. Built with SEO in mind, Astra comes with schema.org code integrated so search engines will love your site. Astra offers plenty of sidebar options and widget areas giving you a full control for customizations. Furthermore, we have included special features and templates so feel free to choose any of your favorite page builder plugin to create pages flexibly. Some of the other features: # WooCommerce Ready # Responsive # Compatible with major plugins # Translation Ready # Extendible with premium addons # Regularly updated # Designed, Developed, Maintained & Supported by Brainstorm Force. Looking for a perfect base theme? Look no further. Astra is fast, fully customizable and beautiful theme!
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-child
Template: astra
*/
CSS

추가할 스타일 코드는 주석으로 작성된 구문 아래에 추가 작성합니다.

functions.php

PHP로 작성된 함수 파일에는 차일드 테마의 스타일시트가 추가되도록 작성되어 있습니다.

<?php
/**
 * Astra Child Theme functions and definitions
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package Astra Child
 * @since 1.0.0
 */

/**
 * Define Constants
 */
define( 'CHILD_THEME_ASTRA_CHILD_VERSION', '1.0.0' );

/**
 * Enqueue styles
 */
function child_enqueue_styles() {

	wp_enqueue_style( 'astra-child-theme-css', get_stylesheet_directory_uri() . '/style.css', array('astra-theme-css'), CHILD_THEME_ASTRA_CHILD_VERSION, 'all' );

}

add_action( 'wp_enqueue_scripts', 'child_enqueue_styles', 15 );
PHP

추가하고자 하는 기능이나 filter, action, , hook 등을 functions.php 작성합니다.

아스트라 테마 관련 글 모두 보기

Scroll to Top