我正在使用twitter bootstrap主题开发wordpress。在我的主页上,我想要一个来自我所有帖子(特色图片)的图像网格,当我点击它们时,该帖子的信息将作为模态框打开。我正在使用显示帖子短信 wordpress插件在主页上显示我所有帖子的精选图片。但现在我的问题是我使用高级自定义字段4.2.2 wordpress插件,带有 WP用户前端:自定义字段,以获取每个帖子的信息,以便每个帖子都有自己的自定义字段传递年份 * 课程名称 * 课程类型和电子邮件 现在我想在用户点击主页上的图像时在模态框中显示所有这些信息。在显示帖子短信中,用链接显示图像的行显示为:
$image = '<a class="image" href="' . get_permalink() . '">' . get_the_post_thumbnail( $post->ID, $image_size ) . '</a> ';
所以我改变它以打开一个模态:
$image = '<a class="image" data-toggle="modal" data-target="#<?php echo $id;?>" href="#">' . get_the_post_thumbnail( $post->ID, $image_size ) . '</a> ';
我制作了一个模板,以显示所有帖子中的精选图片:
<?php
/** _full_width_history.php
*
* Template Name: Full Width History
*
* @author Konstantin Obenland
* @package The Bootstrap
* @since 1.3.0 - 29.04.2012
*/
get_header(); ?>
<section id="primary" class="span12">
<?php echo do_shortcode('[display-posts category="Uncategorized" image_size="thumbnail" posts_per_page="100000"]'); ?>
<div class="modal hide fade modal_width" id="myModal" tabindex="-9" role="dialog">
<div class="modal-body"><button class="close well" type="button" data-dismiss="modal">×</button><br/>
</div></div>
<?php tha_content_before(); ?>
<div id="content" role="main">
<?php tha_content_top();
the_post();
get_template_part( '/partials/content', 'page' );
comments_template( '', true );
tha_content_bottom(); ?>
</div><!-- #content -->
<?php tha_content_after(); ?>
</section><!-- #primary -->
<?php
get_footer();
/* End of file _full_width_history.php */
/* Location: ./wp-content/themes/the-bootstrap/_full_width_history.php */
现在我怎样才能实现它,请帮助我们