index.php

<?php get_header(); ?>
<main class="wrap">
  <section class="content-area content-thin">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
      <article class="article-loop">
        <header>
          <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
          By: <?php the_author(); ?>
        </header>
        <?php the_excerpt(); ?>
      </article>
<?php endwhile; else : ?>
      <article>
        <p>글을 찾을 수 없습니다.</p>
      </article>
<?php endif; ?>
  </section><?php get_sidebar(); ?>
</main>
<?php get_footer(); ?>
  • <?php the_permalink(); ?> – 게시물의 실제 URL을 출력합니다.
  • <?php the_title_attribute(); ?> – 글 제목을 요소 속성과 호환되는 형식으로 표시합니다.
  • <?php the_title(); ?> – 글 제목을 표시합니다.
  • <?php the_author(); ?> – 게시물의 작성자 이름을 출력합니다.
  • <?php the_excerpt(); ?> – 게시물의 발췌문을 추출하며, 작성하지 않으면 자동으로 생성됩니다.
Previous Article

DB 생성 시 문자셋은 무엇을 선택하나요?

Next Article

사이드바 등록하기

0 0 투표
Article Rating
구독
알림
guest
0 Comments
오래된
최신 최다 투표
한 줄 피드백
모든 댓글 보기
0
마음에 들었다면 댓글을 달아주세요.x