기본파일 생성

style.css
/*
Theme Name: zeein yellow
Theme URI: blog.d1p2.com
Description: zeein yellow theme
Version: 1.0
Author: zeein
Author URI: http://blog.d1p2.com
*/
view raw style.css hosted with ❤ by GitHub
functions.php
<?php
if ( ! function_exists( 'zeein_yellow_setup' ) ) :
function zeein_yellow_setup() {
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'zeein-yellow'),
) );
}
endif;
add_action( 'after_setup_theme', 'zeein_yellow_setup' );
function zeein_yellow_scripts() {
// css
// style.css
wp_enqueue_style( 'zeein-yellow-style', get_stylesheet_uri() );
// custom
// script
}
add_action( 'wp_enqueue_scripts', 'zeein_yellow_scripts' );
?>
view raw functions.php hosted with ❤ by GitHub

2. 만약 ‘zeein_yellow_setup’ 함수가 정의되어 있지 않다면(!)
4. primary 라는 고유값을 갖는 메뉴를 만들어라
14. get_stylesheet_uri() : 현재 템플릿 디렉토리에 있는 style.css 파일 로딩

index.php
<?php get_header(); ?>
<div id="container">
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="entry">
<?php the_content(); ?>
<p class="postmetadata">
<?php _e('Filed under&#58;'); ?> <?php the_category(', ') ?> <?php _e('by'); ?>
<?php the_author(); ?><br />
<?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?>
<?php edit_post_link('Edit', ' &#124; ', ''); ?>
</p>
</div><!-- .entry -->
</div>
<?php endwhile; ?>
<div class="navigation">
<?php posts_nav_link(); ?>
</div>
<?php endif; ?>
</div>
<?php get_footer(); ?>
view raw index.php hosted with ❤ by GitHub

6. 타이틀 출력
9. 본문 내용 출력
* 기본적으로 페이지에 있는 “안녕하세요” 글이 노출

header.php
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="profile" href="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_get_archives('type=monthly&format=link'); ?>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="site">
<div id="header">
<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
<?php bloginfo('description'); ?>
</div><!-- #header -->
view raw header.php hosted with ❤ by GitHub

19. functions.php에서 지정한 스타일, 스크립트가 위치

footer.php
view raw footer.php hosted with ❤ by GitHub

7. functions.php에서 지정한 스타일, 스크립트가 위치


위의 내용대로 테마폴더에 파일을 생성하고 zeein-yellow 테마를 선택하고 페이지를 보면 아래와 같은 화면이 출력 됩니다.

 

WOW 자체테마 제작의 첫걸음을 축하 드립니다!!

Share this

Leave your question or feedback

따뜻한 말한마디가 블로거를 춤추게 합니다. 이메일 주소는 공개되지 않습니다.