php - 当新的 WP_Query 在后循环中时出现错误 502
问题描述
我正在尝试在自定义帖子单个模板中设置自定义帖子提要。代码在单个模板或任何其他查询(页面、帖子)之外都可以正常工作。但是当在一个循环中时。它给出错误 502“页面请求被取消,因为完成时间太长”。错误日志为空。
$args2 = array(
'post_type' => 'payout',
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'pay_connection',
'field' => 'slug',
'terms' => '30'
)
)
);
$newquery = new WP_Query( $args2 );
if ( have_posts() ) while ($newquery->have_posts()) : $newquery->the_post();
$custom = get_post_custom($post->ID);
echo $custom['pay_start'][0];
echo $custom['pay_end'][0];
echo '$'. $custom['net_pay'][0];
endwhile;
wp_reset_postdata();
解决方案
推荐阅读
- csv - bigquery 加载自定义记录分隔符
- sql - 为什么这个 SQL 返回 null?
- c++ - ./rcpp: 没有这样的文件或目录:cpp 目标文件的运行时错误
- azure - Thingworx Platform-settings.json 文件未连接到 azure 数据库
- javascript - svg.js 动画组合的情节和 dmove
- android - 如何在全屏范围内打开 AlertDialog
- c++ - 在 C/C++ 中将联合字段中的位解释为不同的数据类型
- python - Python 多处理池在 for 循环中返回相同的输出
- c# - C# - 如何在 AppData 目录中安装数据库?
- mysql - 在结果集中使用条件连接查找两个表的所有数据