因此,我创建了一个自定义循环,在该循环中,我的自定义帖子类型的帖子将出现,并且在其中,我向meta“layout\\u meta\\u box”声明了值“synosis”。自定义帖子类型正在工作,但元框值不工作。我做错了什么?
<?php
/*
Template Name: Archief Synopsis
Template Post Type: algemeen
*/
get_header();
$args = array(
\'post_type\'=> \'televisie\',
\'post_status\' => \'publish\',
\'posts_per_page\' => 5,
\'layout_meta_box\' => \'synopsis\',
);
$custom_query = new WP_Query( $args );
?>
<div class="container-fluid-limited">
<div class="row">
<div class="col-lg-9 col-article">
<h1>Alle artikels over <?php post_type_archive_title(); ?></h1>
<?php
if ( $custom_query->have_posts() ) :
while ( $custom_query->have_posts() ) :
$custom_query->the_post();
get_template_part( \'template-parts/post/content\', \'excerpt\' );
endwhile;
else :
get_template_part( \'template-parts/post/content\', \'none\');
endif;
wp_reset_postdata(); ?>
</div>
<div class="col-lg-3 sidebar">
<?php get_sidebar(); ?>
</div>
</div>
</div>
<?php get_footer(); ?>