要在WordPress中調用所有頁面并排除指定的ID,您可以使用`WP_Query`類。以下是一個示例代碼,它將查詢所有頁面并排除指定的頁面ID:

<?php
// Page ID array to exclude
$exclude_ids = array( 6, 66, 666 ); //Replace here with the page ID you want to exclude

//Create a new WP_Query object
$args = array(
    'post_type' => 'page',
    'posts_per_page' => -1,
    'post__not_in' => $exclude_ids,
);

$custom_query = new WP_Query($args);

// 開始循環
if ($custom_query->have_posts()) :
    while ($custom_query->have_posts()) : $custom_query->the_post();
        // wodepress.com Write your loop content here, for example:
        echo '<h2>' . get_the_title() . '</h2>';
        echo '<div>' . get_the_content() . '</div>';
    endwhile;
endif;

//Reset article data
wp_reset_postdata();
?>

將上述代碼添加到您的主題模板文件(如`page.php`、`index.php`等)中,或者創建一個自定義模板文件并在其中使用這段代碼。這段代碼將查詢所有頁面并排除ID為5、10和15的頁面。您可以根據需要修改`$exclude_ids`數組中的ID。

請注意,如果您使用的是自定義查詢,確保在使用完查詢后調用`wp_reset_postdata()`函數,以便恢復全局`$post`變量。