php - 使用 WCK 插件,当复选框被选中时,我想打印我在后端检查过的内容
问题描述
当复选框被选中时,我想打印我在后端检查过的内容。这里使用了WCK自定义帖子类型插件。下面是我在i中使用的代码。请帮助我。我是wordpress的初学者。
<?php
$args = array(
'post_type' => array('post','research_areas'),
'posts_per_page' => 50
);
$loop = new WP_Query($args);
$i = 0;
while ($loop->have_posts()):
$loop->the_post();
$checkbox = get_post_meta(get_the_ID(), 'latest-research_areas-checkbox', true);
$latest_research = the_cfc_field("latest-research_areas-check", array(
"output" => "raw"
));
if ($latest_research == 1 && $i < 3):
?>
<div class="research_box eqh_3">
<div class="research_inner clearfix">
<?php the_post_thumbnail('full'); ?>
<div class="inner_cont">
<h3><?php the_title(); ?></h3>
<?php the_excerpt(20); ?>
<?php
if (the_cfc_field('reference-url', array(
'raw' => 'true'
))) {
$reference_url = the_cfc_field("reference-url", array(
"output" => "raw"
));
?>
<a href="<?php echo $reference_url; ?>" target="_blank" class="read1">Read More</a>
<?php
} else {
?>
<a href="<?php the_permalink(); ?>?rid=res_home" class="read1">Read More</a>
<?php }
?>
</div>
</div>
</div>
<?php
$i++;
endif;
endwhile;
wp_reset_query();
?>
解决方案
推荐阅读
- ios - 在 xCode 中禁用链接预览
- javascript - 检索在单独文件中声明的选择对象
- python - Pandas 数据框,根据唯一值的数量选择 n 个随机行
- python - 如何从 AWS PySpark 中加载的 python 包加载本地资源
- android - 如何在 Android 中将 Shipbook 远程日志记录平台与 Timber 集成?
- r - 如何将累积时间序列转换为 R 中的非累积时间序列?
- c - 在这种情况下 sizeof 是如何工作的?
- python - 比较两列中的值
- javascript - Mobx 加载包装器 React
- linux - 将csv文件导入greenplum外部表时如何转义换行符?