Wordpress:查询在登录时显示帖子,但在注销时不显示。不设私人。

时间:2015-12-03 20:22:06

标签: php wordpress

我完全不知所措。我正在管理其他人的Wordpress安装,但这是一个新问题,以前从未发生过。

我有一个显示自定义帖子类型查询的页面。该查询有效,并显示自定义帖子。当我退出时,查询不会生成任何结果。这些帖子肯定是“公共”而不是私人。他们肯定是出版,而不是草稿。它们会显示在其他页面上的其他查询中,但在这一页上,没有运气。我不能为我的生活修好它!以下是该页面的代码:

<?php /*
      Template Name: Classes Template
 */ ?>

<?php get_header(); ?>

   <?php 

$wmodulepage = get_post_meta(get_the_ID(), 'wmodulepage', true);

?>

<div style="padding-top:10px; background:#fff;">

 <div class="pageInfo">

        <div class="container">

            <div class="eight columns pageTitle">

                <h1><?php the_title(); ?></h1>

            </div>

            <div class="eight columns breadcrumb">

               <?php if(function_exists('bcn_display')) {
                        bcn_display();
                        }?>

            </div>

        </div>

    </div>

  <ul id="reset">

  <li><a class="reset" href="#" data-filter=".one-third">reset</a></li>


</ul>


   <div class="pageContentWrapper">

        <div style="padding-top:10px; background: url(<?php echo get_template_directory_uri(); ?>/images/newBg.jpg)  no-repeat fixed center;">

        <div class="container">


            <center><hr><a class="button-big lightblue rounded3" href="http://millmountain.org/education">ALL</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="button-big purple rounded3" href="http://millmountain.org/class/pre-k">PRE-K</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="button-big taupe rounded3" href="http://millmountain.org/class/k-2">K-2</a>&nbsp;&nbsp;&nbsp;&nbsp;<!--<a class="button-big teal rounded3" href="../class/summer-camps">SUMMER CAMPS</a>&nbsp;&nbsp;&nbsp;&nbsp;--><a class="button-big brown rounded3" href="http://millmountain.org/class/elementary">ELEMENTARY</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="button-big purple rounded3" href="http://millmountain.org/class/middle-school">MIDDLE SCHOOL</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="button-big teal rounded3" href="http://millmountain.org/class/high-school">HIGH SCHOOL</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="button-big teal rounded3" href="http://millmountain.org/class/adult">ADULTS</a>&nbsp;&nbsp;&nbsp;&nbsp;<br><hr></center>



                  <ul class="classesPost dd_classes_widget widget clearfix ">



                    <?php

global $paged;

$arguments = array(
    'post_type' => 'post_classes',
    'post_status' => array( 'publish', 'private' ),
    'meta_key' => 'class-order',
    'orderby' => 'meta_value',
    'order' => 'ASC',
    'paged' => $paged
);


// WP_Query arguments
$args = array (
    'post_type'              => array( 'post_classes' ),
    'post_status'            => array( 'publish' ),
);

// The Query
$my_Classes_Query = new WP_Query( $args );

// The Loop
if ( $my_Classes_Query->have_posts() ) {
    while ( $my_Classes_Query->have_posts() ) {
        $my_Classes_Query->the_post();
?>

                       <li <?php post_class('one-third column'); ?>>

                              <?php 

$thumbimg = get_post_meta(get_the_ID(), 'thumbimg', true);


?>

                            <div class="wrapper">


                                <?php if( $thumbimg) { ?>

                                  <div class="postThumb"><a href="<?php the_permalink(); ?>"><img src="<?php echo $thumbimg; ?>" alt="" /></a></div>

      <?php } ?>    






                            <div class="postDetails">

                                <a href="<?php the_permalink(); ?>" class="postTitle"><h1><?php the_title(); ?></h1></a>
                                <?php the_excerpt(); ?>
                                 <a class="button-small red rounded99" href="<?php the_permalink(); ?>"><?php _e('MORE INFO', 'localization'); ?></a>

                            </div>

                            </div>

                        </li>

<?
    }
} else {
    // no posts found
}

// Restore original Post Data
wp_reset_postdata();



?>













                 </ul>


<h1 style="text-align: center;">Supporters</h1>
<p style="text-align: center;">The following organizations have given grants that support the MMT Conservatory programs:</p>
<?php echo do_shortcode( '[gallery  columns="7" ids="2511,2512,2513,2514,2515,2516,2517"]' ); ?><br><br>


                   <?php
                            kriesi_pagination();

                            dd_restore_query();
?>                  



        </div>

    </div>

 <?php if ( $wmodulepage == 'yes') { ?>

<div class="widgetModuleWrapper">

    <ul class="widgetModule container clearfix">

          <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar("Widgetized Module")) ; ?>

    </ul>

    </div>

</div>

</div>
        <?php } ?>

<?php get_footer(); ?>

我包含了整个模板,以防我可能忽略了导致问题的查询和循环之外的内容。有人可以帮忙吗?我很困惑。我重写了查询和循环,没有成功。我甚至用不同的模板替换了这个页面,用于不同的自定义帖子类型,更改了查询中的帖子类型,并获得了相同的结果。它似乎与帖子本身有关,而不是查询,但我不知道如何从这里进行故障排除。

0 个答案:

没有答案