[팁] 워드프레스 테마 만들기(1)
2023.04.26 07:38
0
https://eond.com/451966

1. 필수 파일

/themaname/index.php
/themaname/style.css

이 두개 파일이 필수파일입니다.

style.css파일이 있어야 관리자 > 외모 > 에서 테마가 나타납니다.

style.css는 빈 내용이어도 상관 없습니다. 단 파일 자체가 없으면 테마 선택에 나타나지 않으니 기본 파일은 생성해두세요.

Theme Name: 뉴스고
Author: 아이두프레스(idoopress)
Author URI: http://idoopress.com/
Description: 테마에 대한 설명
Version: 1.0
Tags: 뉴스테마

2. index.php에서 style.css 연결하는 방법

잘못된 방법
<link rel="stylesheet" href="assets/css/style.min.css?time=3">

옳은 방법
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/assets/css/style.min.css">

이렇게 하셔야 /wp-content/themes/themaname/ 디렉토리로 연결됩니다.

/wp-content/themes/themaname/style.css를 바로 연결하시려면 아래 코드를 사용하시면 됩니다.

<link rel="stylesheet" type="text/css" media="all" href="<?php echo esc_url( get_stylesheet_uri() ); ?>" />


이제 기본적인 테마 구조는 완성되었습니다. 

이제 여러분의 테마를 만들어보세요.


3. 메인 최신글 연결하기

4. 서브 게시판 연결하기

다음 편에는 위 내용에 대해 알아보도록 하겠습니다.

라이믹스는 이온디와 함께

닫기

마이페이지

로그인을 해주세요