您的问题很模糊,您没有给出任何示例代码,但以下内容可能适合您:
<?php
global $post;
// Arguments
$args = array(\'
/* Enter your arguments in here... */
\');
// The query
$the_query = new WP_Query( $args );
// The loop
if ( $the_query->have_posts() ) {
// Exclude ID
$exclude_id = get_post_meta( $post->ID, \'exclude_field\', true );
while ( $the_query->have_posts() && $post->ID !== $exclude_id ) {
$the_query->the_post();
/*
Output here, e.g.
echo \'<h2>\' . get_the_title() . \'</h2>\';
echo \'<div>\' . get_the_content() . \'</div>\';
*/
}
}
?>