Contenu connexe Similaire à Divi custom post type template (20) Plus de Donghyeok Kang (8) Divi custom post type template3. Theme Custom Post Type templates
• single-{post-type}.php
• archive-{post-type}.php
• search.php
• index.php
출처) https://developer.wordpress.org/themes/template-files-section/custom-post-type-template-files/
4. Two custom post types
• 강의 • 템플릿
제목: WPxGangnam
날짜: 2019-06-17
시간: 저녁 7시
장소: 마이워크스페이스
강사: 고재영, 강동혁
사진:
설명:
사진
제목:
날짜:
시간:
장소:
강사:
<설명>
6. Live WordPressing
1. Divi child theme
2. Custom Post Type UI, Advanced Custom Fields 플러그인 설
치
3. CPT 강의, 템플릿 생성
4. Divi 빌더 설정
5. 강의 필드 생성
6. 템플릿 생성
7. 강의 생성
8. 템플릿 PHP 파일 생성 – single-class.php
7. single.php
<?php get_header(); ?>
<div id="main-content">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<?php
the_content();
?>
</div> <!-- .entry-content -->
</article> <!-- .et_pb_post -->
<?php endwhile; ?>
</div> <!-- #main-content -->
<?php get_footer();
8. single-class.php
<?php get_header(); ?>
<div id="main-content">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<?php
// the_content();
$page = get_page_by_path('class-template', OBJECT, 'template');
echo apply_filters('the_content', $page->post_content );
?>
</div> <!-- .entry-content -->
</article> <!-- .et_pb_post -->
<?php endwhile; ?>
</div> <!-- #main-content -->
<?php get_footer();