워드프레스 테마 제작

기본구조

index.php
<!doctype html>
<html <?php language_attributes(); ?>>
  <head>
    <meta charset="<?php bloginfo('charset'); ?>">
    <title><?php bloginfo('name'); //현재 보여주는 페이지에 맞는 제목 ?> <?php wp_title('|'); ?></title>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); //style.css와 연결 ?>">
    <?php wp_head(); ?>
  </head>
  <body <?php body_class(); ?>>
  <?php wp_footer(); ?>
  </body>
</html>

함수

글 정보

<?php if ( is_home() || is_category() || is_tag() ) {
    the_excerpt();
 
} else {
    the_content();
} ?>

이렇게 하면 첫화면 등에서는 요약글이 나오고, 포스트 제목을 클릭하면 포스트 내용 전체가 나온다. Conditional Tag 참조

functions.php

기능의 사용 여부를 정하거나 여러 설정을 하는 파일임

<?php
  // Thumbnails
  add_theme_support( 'post-thumbnails' );
?>

같이 보기

http://www.cmsfactory.net/node/10237

역링크