wordpress - ACF CPT UI 帖子列表
问题描述
<?php
$posts = get_posts(array(
'posts_per_page' => -1,
'post_type' => 'urunlerimiz' ));
if( $posts ): ?>
<div class="col-lg-9 col-md-8 left-column sidebar-type-left col-sm-12 col-xs-12">
<div class="services portfolio-list-section">
<div class="row portfolio-masonry-holder list-works clearfix" style="">
<?php foreach( $posts as $post ): setup_postdata( $post ); ?>
<div class="col-xs-12 col-sm-4 item <?=get_the_ID()?> " style="">
<div class="service-item">
<div class="service-item-image">
<a href="<?php the_permalink(); ?>">
<div class="img-hover-effect">
<img style="width:400px; height:250px;" src="<?php echo get_the_post_thumbnail_url(); ?>" class="full-width wp-post-image" alt="" loading="lazy">
</div></a>
</div>
<div class="service-item-footer">
<a href="<?php the_permalink(); ?>"><h4><?php the_title(); ?></h4></a>
<a class="btn btn-style-global btn-style-0" href="<?php the_permalink(); ?>">
<span>DEVAMINI OKU</span></a>
</div>
</div>
</div>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
</div></div></div>
对于 ACF CPT UI 自定义帖子类型列表
您好,使用此代码,您可以列出您创建的帖子类型。
根据您创建的帖子类型排列代码中的字段就足够了。另外,如果您想通过指定 CSS 或 class 进行编辑,请更改相关的 class 字段。
解决方案
推荐阅读
- tensorflow - @tf.custom_gradient 处于急切模式,参数复杂
- python - 在 tmux 窗口中生成输出时无法滚动 Ipython(不是笔记本!)
- python - 构建分层字符串
- python - 解包元组返回错误的结果
- node.js - 我如何获得由 discord bot 制造商创建的 Discord Bot 以在 Heroku 上工作
- c - A mm:ss 定时器 C
- subdomain - Asp Net Core 2、IIS Express 和子域
- c# - windows 包可以包含在安装程序中吗?
- go - 在 repo 中使用多个模块时,Go get 找不到本地包
- php - 如何仅迭代数组的前 3 个元素并访问键/值?