我会用插件解决这个问题Advanced Custom Fields.
1) 使用以下配置创建ACF项目view larger
2) 编辑帖子时,它将显示一个元框,您可以在其中选择帖子应显示的页面
3) 在页面模板中,根据需要调整此代码
<?php
// START - THE LOOP
$the_ID = $post->ID;
$search_posts = get_posts(array(
\'numberposts\' => -1,
\'post_type\' => \'post\',
\'meta_key\' => \'show_this_post_on_page\'
));
if($search_posts) {
foreach($search_posts as $post_found) {
$key_value = get_post_meta($post_found->ID, \'show_this_post_on_page\', true);
foreach($key_value as $key => $value) {
if($value==$the_ID) echo \'The post <strong>\'.$post_found->post_title.\'</strong> should appear in this page\';
}
}
}
// END - THE LOOP
?>