wp_query()while语句不起作用

时间:2016-04-15 11:32:00

标签: wordpress while-loop

我正在尝试运行wp_query()并运行查询但是while语句不会执行。

global $current_user;
                                get_currentuserinfo();
                                $user_id = $current_user->ID;

$query = new WP_Query(array('post_type' => 'profile', 'posts_author' => $user_id ) );

if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post();


if(isset($_GET['post'])) {

if($_GET['post'] == $post->ID) {

ob_start();
the_content();
$old_content = ob_get_clean();
$new_content = strip_tags($old_content);
    $current_post = $post->ID;

    $pharaohs_cover_image = esc_url(get_post_meta($post->ID, 'pharaohs_cover_image',true));
    $pharaohs_fullname = esc_attr(get_post_meta($post->ID, 'pharaohs_fullname',true));
    $pharaohs_nickname = esc_attr(get_post_meta($post->ID, 'pharaohs_nickname',true));
    $pharaohs_gender = esc_attr(get_post_meta($post->ID, 'pharaohs_gender',true));
    $pharaohs_interestedIn = esc_attr(get_post_meta($post->ID, 'pharaohs_interestedIn',true));
    $pharaohs_likes = esc_attr(get_post_meta($post->ID, 'pharaohs_likes',true));
    $pharaohs_profile_picture = esc_url(get_post_meta($post->ID, 'pharaohs_profile_picture',true));




}

}

ENDWHILE;  ENDIF;

任何帮助都将受到高度赞赏,请提前感谢...

0 个答案:

没有答案