- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个名为“今天”的自定义字段(重复器)。其中,我有一个“选择日历日期”子字段。
在产品 (woocommerce) 上,我添加了 1、2、3 或更多日期。返回日期类似于 dd/mm,我将今天的日期与类似日期(d/m)进行比较。
问题是加载时间非常长,而且我没有得到任何结果......
我尝试过的:
$today = date('d/m');
$args = array(
'numberposts' => -1,
'post_type' => 'product',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'today_$_mdate',
'compare' => '=',
'value' => $today
)
)
);
$the_query = new WP_Query( $args );
if( $the_query->have_posts() ): ?>
<ul>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php endwhile; ?>
</ul>
<?php else:
echo "No prods"; endif; ?>
<?php wp_reset_query();
转发器字段:今天
子字段:日期
为什么我不能只返回中继器字段子字段设置为的产品今天的日期?它甚至不返回。
这是 WP 中的产品句柄:http://prntscr.com/kkobbb
这是自定义字段集:http://prntscr.com/kkobqo
$today returns `20/08`
新方法:
$today = date('d/m');
$args = array(
'post_type' => 'product',
'posts_per_page' => -1
);
$products = new WP_Query( $args );
if ( $products->have_posts() ) {
echo '<ul>';
while ( $products->have_posts() ) {
$products->the_post();
if( have_rows('today') ):
while ( have_rows('today') ) : the_row();
the_sub_field('mdate');
endwhile;
else :
// no rows found
endif;
}
echo "</ul>";
}
wp_reset_query();
仍然需要大量的加载时间...以及消息 fatal error :允许的内存大小为 536870912 字节耗尽...在 wp-includes/plugin.php 第 179 行
但至少,我可以根据其转发器子字段过滤产品。
最佳答案
此问题已修复。从 ACF 自定义字段设置中,只需将重复器字段架构设置为行而不是表。对我来说,它已设置为表格,但我加载时间很长并且崩溃。
关于wordpress - ACF 中继器字段,具有按今天日期检查的多个子字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51926005/
我找到了很好的函数 =GOOGLEFINANCE("AAPL";"price";TODAY(); today()-60) 可以给出指定日期范围内的股票价格 - 它工作正常。我试图用它来获取 EPS 或
基于云计算的大规模即时云渲染技术,让每个人都拥有了“数字生命”。 2023的开年爆款,非《流浪地球2》莫属。 它展开了人类的新话题,关于平行空间,关于数字生命,关于人类文明
我试图过滤掉比今天更大的日期。我查找了语法,但日期部分不起作用;我仍然在结果中得到日期 > 今天。 有人可以帮我解决这个问题吗?!谢谢!这是查询: =iferror(sort(if(isblank(S
这就是我现在所拥有的: set_time_limit(120); $now = (new \DateTime)->format('Y-m-d H:i:s'); $nowYmd = (new \Date
这个问题在这里已经有了答案: 关闭 12 年前。 Possible Duplicate: Select * from table where date = today 你好,我正在尝试做一个 mys
我使用 CouchDB 作为事件日志,我想在它之上构建简单的 UI,以便我可以更轻松地查询事件。 我可以使用原始 HTTP 调用并手动构建 View ,也可以使用 CouchApp 框架。 问题是这些
我似乎无法在“小部件模拟器”中运行“今日”小部件(或与此相关的任何扩展名)。模拟器启动,并说“无法打开小部件”以及 Failed to find Widget /Users/SomeUser/Libr
我正在使用来自此来源的日期选择器 http://jqueryui.com/datepicker/#buttonbar ,我正在尝试让按钮栏上的“今天”按钮处于事件状态,请任何人帮助我。 $(".dat
我是Prometheus和警报方面的新手,我无法通过查看文档来完善答案。 我有一些数据即将进入Elasticsearch集群。每天,该过程都会在Elasticsearch上创建一个新索引,并将当天的数
我有一个应用程序和一个今天的扩展程序,它们使用安全组标识符共享Core Data持久性存储。 主应用程序更新Core Data存储,而扩展名仅从存储中读取。 我在应用程序和扩展程序中都使用了NSFet
我在项目中完成了Today扩展的一半。 我不必向公众发布半成品,但也希望保持相同的代码库,这样可以节省代码维护时间。 没有人知道没有内置“今日”扩展程序的发布应用程序的方法吗? 谢谢 最佳答案 在应用
我花了很长时间来了解段注册的内容目的是?我已经准备好知道这来自过去 (8086)只有 1 MByte 的物理内存。但是CPU有只有 16 位宽的地址寄存器。有了这 16 个地址位你只能寻址 64K 字
我有一个表格,其中包含成员(member)加入俱乐部时输入的日期。该列是沼泽标准,类型为 DATE。不需要时间。 基本上,我正在尝试找到一种 future 不可能的方式? 最佳答案 您可以使用触发器。
我需要获取早于或等于今天的日期。我正在使用 C# LINQ。 只是想知道以下是否是最有效的方法: pr.PgDate >= DateTime.Today 最佳答案 视情况而定,假设您使用的是将其直接转
$str = 'BEGIN This is a "quote" test. \'Single\' END'; echo $str . "\n"; echo mysql_real_escape_stri
在 HTML 5 中是否支持在 Silverlight 中真正容易做到的事情? 例如,将一个文件(由用户选择)转换为一个字节数组,该字节数组可以进行 base64 编码并传递给网络服务? 或者,创建/
使用 Oracle,如何在 11:59:59 选择当前日期(即 SYSDATE)? 考虑到午夜的定义might be a little ambiguous (星期四午夜是指跨越星期四和星期五还是跨越星
My Today 扩展需要有一个基于小部件显示内容的动态高度。我能够通过在最底部元素上添加约束来实现这一点:底部布局指南的顶部小于或等于最底部元素的底部,常量为 0,优先级为 999,乘数为 1。 这
我相信你们中的许多人已经查看了今天的 (2011-02-08) Google's doodle (link to article on CNN if doodle changes)。这太棒了,我试着弄
如下所示: ? 1
我是一名优秀的程序员,十分优秀!