首页 > 解决方案 > 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 字段。

标签: wordpresspluginsadvanced-custom-fieldscustom-post-type

解决方案


推荐阅读