作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 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/
我有一个具有可变数量子元素的固定大小的 div。我不知道 children 的大小。目标是缩小它们以适合父级。 例子: .parent { width: 100px; height: 100p
我是一名优秀的程序员,十分优秀!