Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
wordpress 3.7更新后查询_帖子不工作_Wordpress - Fatal编程技术网

wordpress 3.7更新后查询_帖子不工作

wordpress 3.7更新后查询_帖子不工作,wordpress,Wordpress,我最近更新到wordpress 3.7,我的帖子页面突然停止工作。它不显示任何内容,并打开一个空白页。该页面上有小代码,它停止工作。它曾使用query\u posts获取帖子,但现在出现了一个银行页面 代码 <? query_posts ('cat=-103&posts_per_page=1') ?> <? while (have_posts ()) { the_post (); ?> <div class="reu-sec">

我最近更新到wordpress 3.7,我的帖子页面突然停止工作。它不显示任何内容,并打开一个空白页。该页面上有小代码,它停止工作。它曾使用
query\u posts
获取帖子,但现在出现了一个银行页面

代码

    <? query_posts ('cat=-103&posts_per_page=1') ?>

 <? while (have_posts ()) { the_post ();  ?>

    <div class="reu-sec">

        <h2><a href="<? the_permalink() ?>"><? the_title (); ?><span class="sbttlmn"> &nbsp <?= get_post_meta (get_the_ID(), 'sub-title', true); ?></span></a></h2>

        <div class="desc">

            <? //the_content ('[More]'); ?>

            <div class="reu-prev1"><a href="<? the_permalink() ?>"><img src="<?= get_post_meta (get_the_ID(), 'image', true); ?>"/></a></div>

            <div class="reu-prev2"><a href="<? the_permalink() ?>"><img src="<?= get_post_meta (get_the_ID(), 'image2', true); ?>"/></a></div>

            <div class="reu-prev3"><a href="<? the_permalink() ?>"><img src="<?= get_post_meta (get_the_ID(), 'image3', true); ?>"/></a></div>

        </div>

        <div style="clear: both"></div>

    </div>

<?php }  ?>

首先,在
WP config.php
中启用
WP\u DEBUG

define( 'WP_DEBUG', true );
然后返回到有问题的页面,您应该会看到一个PHP致命错误(我假设)或一些其他错误消息,描述该问题的来源-一旦得到该错误,请将其发布在此处(出于隐私考虑,您应该删除完整的路径信息)


如果您不可能做到这一点,请尝试将简短的php标记切换为普通标记。这意味着替换所有出现的
。主要问题是它对已登录的用户有效,但对未登录的用户无效。。。仍然-您是否尝试让WP_调试并查看是否出现了问题?如果您不想为所有访问者启用WP_调试,您可以简单地执行以下操作:
If(isset($_GET['testing']){define('WP_DEBUG',true);}else{define('WP_DEBUG',false);}
然后转到相关页面,在URL末尾添加测试。