【发布时间】:2014-05-14 12:31:09
【问题描述】:
我正在尝试在灯箱中打开 the_content(只是图片)。 我想要一个像圣诞节日历这样的页面,这样您就可以看到帖子(以及计划中的帖子),如果您单击已发布的帖子,图像(the_content)应该显示在阴影框、灯箱或其他任何东西中,我想你会明白我的意思。现在我的代码看起来像:
<header class="entry-header" rel="shadowbox" onclick="location.href='<?php the_permalink();?>';" style="cursor:pointer;">
<?php if ( ! post_password_required() && ! is_attachment() ) :
the_post_thumbnail();
endif; ?>
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php else : ?>
<?php endif; // is_single() ?>
<?php if ( comments_open() ) : ?>
<div class="kalender">
<p1> <?php the_field('nummer'); ?> </p1>
<br>
<p2><?php the_time('j. F Y'); ?> </p2>
<p3><?php the_title(); ?></p3>
</div>
<!-- .comments-link -->
<?php endif; // comments_open() ?>
</header>
我认为最简单的方法是像处理 read_more 链接一样处理 the_content,然后在 shadowbox 中说 onclick show。但现在我只是不知道该怎么做。你可以看看here(现在只在Firefox或Safari,不知道为什么Chrome讨厌我:-))
【问题讨论】:
标签: javascript php jquery wordpress shadowbox