워드프레스 테마를 준비해보자
IT/Wordpress 2024. 9. 21. 00:26워드프레스 테마 준비하기
1. wp-content 하위에 폴더 생성 후, function.php, style.css, index.php 생성하기
2. function.php 내부는 비우고, styles.css 는 다음 코드를 추가한다.
/*
Theme Name: My Custom Theme
Theme URI: http://example.com
Author: Your Name
Author URI: http://example.com
Description: A custom theme for my WordPress site.
Version: 1.0
*/
3. index.php 에서 다음 코드를 추가한다.
<?php
// 기본 테마 템플릿 파일
get_header(); // 헤더 호출
if ( have_posts() ) :
while ( have_posts() ) : the_post();
the_title('<h1>', '</h1>');
the_content();
endwhile;
else :
echo '<p>No posts found</p>';
endif;
get_footer(); // 푸터 호출
?>
4. 워드프레스 어드민 페이지의 테마 선택 화면으로 이동한다.
5. 테마 선택 목록에서 2번에서 추가한 테마 이름를 활성화 한다.
테마 기본 구성을 알아 봤다.
워드프레스 멀티 사이트 + AWS + HTTPS 적용 시, 쿠키 오류를 해결해 보자 (7) | 2024.09.22 |
---|---|
테마의 로고 이미지 업로드 기능 추가하기 (0) | 2024.09.21 |
워드프레스 설치하기 (4) | 2024.09.21 |
iptime ddns를 활용한 워드프레스 사이트 구성 (0) | 2024.05.30 |