如何获得同位素Wordpress插件薄荷主题的工作?

问题描述 投票:0回答:1

我已经安装了Mintthemes的WordPress插件Isotope。但是我没有让它发挥作用。我在page.php中设置了以下代码片段,并填写了自定义帖子类型使用的可选设置。

<?php moveplugins_isotopes(); ?>

为我的自定义帖子类型组合项添加了类别,但它不起作用。

我的代码:

<?php moveplugins_isotopes(); ?>

<ul class="entrybox">
<?php 
    $args = array('post_type' => 'portfolio');
    $loop = new WP_Query($args);
?>

<?php if ($loop->have_posts()) : while ($loop->have_posts()) : $loop->the_post(); ?>

    <li class="grid_4 portfolio-post">
    <a href="<?php the_permalink(); ?>">
    <div class="thumbnail">
        <img src="<?php print IMAGES; ?>/portfolio/thumbnails/thumbnail.png" alt="Thumbnail">
    </div><!-- End .thumbnail -->
    </a>

    <div class="description">
        <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
        <?php the_excerpt(); ?>
    </div><!-- End div.description -->
    </li><!-- End li.grid_4 projectbox -->

<?php endwhile; ?>
<?php endif; ?>
</ul><!-- End ul.entrybox -->
wordpress plugins jquery-isotope
1个回答
0
投票

问题是你的li没有在WordPress中使用post_class函数。它使用该post_class来标识循环中的哪些项。

应该是这样的

<li class="<?php post_class( array('grid_4', 'portfolio-post') ) ?>">

你可以在这里找到更多相关信息:http://codex.wordpress.org/Function_Reference/post_class

© www.soinside.com 2019 - 2024. All rights reserved.