繁体   English   中英

编辑WordPress网站的PHP网格页面

[英]Editing PHP grid page for WordPress site

我想编辑“网格艺术家”页面,使其只有12位艺术家,并在“制作人”区域中着陆,而不是所有艺术家。

这是网站页面的链接: http : //cascaderecords.fr/roster/

PHP代码:

<?php
if (ci_setting('artists_isotope') == 'enabled' AND !wp_is_mobile() AND !is_tax() ):
    ?>
    <ul class="filters-nav group">
        <li><a href="#filter" class="selected" data-filter="*"><?php _e('All Artists', 'ci_theme'); ?></a></li>
        <?php
            $args = array('hide_empty' => 1);
            $cats = get_terms('artist-category', $args);
        ?>
        <?php foreach ( $cats as $cat ): ?>
            <li><a href="#filter" data-filter=".<?php echo $cat->slug; ?>"><?php echo $cat->name; ?></a></li>
        <?php endforeach; ?>
    </ul>
    <?php
endif; // is isotope enabled

global $paged;
if ( ci_setting('artists_isotope') == 'enabled' AND !wp_is_mobile() AND !is_tax() ) {
    $args = array(
        'post_type' => 'cpt_artists',
        'posts_per_page' => -1
    );
}   else {
    $args = array(
        'post_type' => 'cpt_artists',
        'posts_per_page' => ci_setting('artists_per_page'),
        'paged' => $paged
    );
}

$the_query = !empty($the_query) ? $the_query : new WP_Query($args);
?>



<article class="row">
<ul class="col-md-12 items-list-grid filter-container <?php echo $filter; ?>">
    <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
        <?php $cats = wp_get_object_terms($post->ID, 'artist-category'); ?>

        <li class="<?php foreach ( $cats as $cat ) : echo $cat->slug.' '; endforeach; echo $grid;  ?>">
            <article id="artist-<?php the_ID(); ?>" <?php post_class('row'); ?>>
                <div class="col-md-12">
                    <?php if ( has_post_thumbnail() ) : ?>
                        <figure>
                            <a href="<?php the_permalink(); ?>">
                                <?php the_post_thumbnail('ci_thumb_square'); ?>
                            </a>
                        </figure>
                    <?php endif; ?>


                    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

                </div><!-- /col-md-12 -->
            </article><!-- /row -->
        </li><!-- /col-md-4 -->
    <?php endwhile; wp_reset_postdata(); ?>
</ul>

尝试更改:

'posts_per_page' => -1

至:

'posts_per_page' => 12

不确定下面的变量中有什么“ ci_setting('artists_per_page')”,需要更多信息:

'posts_per_page' => ci_setting('artists_per_page'),

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM