我试图从显示中排除特定的帖子ID。我已将帖子ID作为post__not_in
但我不确定是否有一个错误,是否需要进行任何明显的更改?
<?php
// Create a variable to hold our custom Loop results
$frontpageposts = get_posts( array(
\'numberposts\' => 1, // only the 3 latest posts
\'post__not_in\' => \'-4135\'
) );
// Create output only if we have results
// Customize to suit your HTML markup
if ( $frontpageposts ) {
foreach ( $frontpageposts as $fppost ) {
// setup postdata, so we can use template tags
setup_postdata($fppost);
?>
<div <?php post_class(); ?>>
<h4><a href="<?php the_permalink(); ?>"><?php //the_title(); ?>Latest News #1</a></h4>
<div class="post-entry">
<?php the_post_thumbnail(); ?>
<?php //the_excerpt(); ?>
</div>
</div>
<?php }
}
?>
Error
警告:array\\u map():参数#2应该是/var/www/vhost/testdomain中的数组。co.uk/faiauto/wp-includes/query。php在线2451
警告:implode():在/var/www/vhosts/testdomain中传递的参数无效。co.uk/faiauto/wp-includes/query。php在线2451