javascript - 带有缩略图的 WordPress 扩展网格

标签 javascript css wordpress grid expand

我正在使用 codrops 解决方案在扩展网格中显示团队成员:http://tympanus.net/codrops/2013/03/19/thumbnail-grid-with-expanding-preview/

我已经能够更改一些代码以在网格预览中显示我的帖子缩略图。但是,我想在展开 View 中以全尺寸显示相同的图片。在原始版本中,它会在名为 1.jpg 的文件中抓取图像。如何实现抓取我的缩略图?

这是我的 PHP/HTML:

<ul id="og-grid" class="og-grid">
<?php $args = array( 'post_type' => 'mitarbeiter');
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post(); ?>
    <li>
        <a href="mailto:<?php the_field('email')?>" data-largesrc="images/1.jpg" data-title="<?php the_title(); ?>" data-description="<?php the_field('funktion') ?><br /><br />Rufen Sie mich an unter <?php the_field('telefonnummer')?> oder schreiben Sie mir eine Nachricht.">

            <?php
            if ( has_post_thumbnail() ) {
            the_post_thumbnail('team');
            }
            else {  } ?>
        </a>
        <?php the_title(); ?>

    </li>
<?php endwhile; ?>

原始 CSS 只是稍作改动以满足我的需要:https://github.com/codrops/ThumbnailGridExpandingPreview/blob/master/css/component.css

原始 JS 没有变化:https://github.com/codrops/ThumbnailGridExpandingPreview/blob/master/js/grid.js

最佳答案

请查看您的代码:

data-largesrc="images/1.jpg"

将此更改为您的缩略图网址。

关于javascript - 带有缩略图的 WordPress 扩展网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30997537/

相关文章:

javascript - 运行 Edge 动画时在 Google Chrome 上遇到双声问题

wordpress - 只有一个媒体查询被应用

php - 严重的 CSS 情况。完全难倒

javascript - 响应式导航随着 display flex 变得不稳定

jquery - CSS/图像翻转/jQuery?

php - WordPress 骨架、VVV、多站点和正确的 Nginx 规则

php - 如何读取我网站中的 wordpress cookie?

javascript - 你如何在 JavaScript 中编写来自 JSON 的空键?

javascript - deviceReady 在PhoneGap 应用程序中不起作用,怎么办?

javascript - 如何检查带有 .Attr 的元素是否具有特定类?