我使用PHP和WordPress创建了一个包含三个帖子的滑块。现在,我想用现有帖子之一替换最新帖子。我该怎么办?
<?php
for ($cnt2 = 1; $cnt2 <= 2; $cnt2++) {
$pin_to = get_post_meta($latest_post_array [$cnt2] ["id"], 'pin_to', true);
$pin_at = get_post_meta($latest_post_array [$cnt2] ["id"], 'pin_slider_no', true);
if ($pin_at == "s0" || $pin_at == "") {
$popupvideoads2 = "N";
} else {
if ($pin_to > $today) {
$popupvideoads2 = "Y";
}
}
}