style.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Theme Name: zeein yellow | |
Theme URI: blog.d1p2.com | |
Description: zeein yellow theme | |
Version: 1.0 | |
Author: zeein | |
Author URI: http://blog.d1p2.com | |
*/ |
functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); | |
?> |
2. 만약 ‘zeein_yellow_setup’ 함수가 정의되어 있지 않다면(!)
4. primary 라는 고유값을 갖는 메뉴를 만들어라
14. get_stylesheet_uri() : 현재 템플릿 디렉토리에 있는 style.css 파일 로딩
index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> | |
<?php the_author(); ?><br /> | |
<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> | |
<?php edit_post_link('Edit', ' | ', ''); ?> | |
</p> | |
</div><!-- .entry --> | |
</div> | |
<?php endwhile; ?> | |
<div class="navigation"> | |
<?php posts_nav_link(); ?> | |
</div> | |
<?php endif; ?> | |
</div> | |
<?php get_footer(); ?> |
6. 타이틀 출력
9. 본문 내용 출력
* 기본적으로 페이지에 있는 “안녕하세요” 글이 노출
header.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 --> |
19. functions.php에서 지정한 스타일, 스크립트가 위치
footer.php
7. functions.php에서 지정한 스타일, 스크립트가 위치
위의 내용대로 테마폴더에 파일을 생성하고 zeein-yellow 테마를 선택하고 페이지를 보면 아래와 같은 화면이 출력 됩니다.
WOW 자체테마 제작의 첫걸음을 축하 드립니다!!