0
我有一個教程中的代碼。在這裏,我想讓點擊時的縮略圖,動態模式將顯示,用戶可以在其中編輯onlick模式中的內容。我有一個類別列表,在我的縮略圖中,我把<a href>
顯示出我的模式。我是一個初學者在WordPress的單擊模式顯示時的圖像縮略圖
我的問題:我真的不明白我在哪裏可以創建我的模態?我知道關於我的模態的循環帖子,但它是一個帖子嗎?我會在哪裏創建我的動態模態?是否通過郵寄? 。我應該創建一個帖子,以及如何將它鏈接到一個模式?我應該創建一個類別來知道這個帖子是一個模式嗎?
下面是代碼:
<div class="row">
<div class="col-xs-4">
<ul class="categories-filters">
<?php
$args2 = array(
'exclude' => array(6,3,2),
'order' => 'DESC',
'title_li' => __(''),
'posts_per_page' => '6',
'hierarchical' => 'true'
);
wp_list_categories($args2);
?>
</ul>
</div>
<div class="col-xs-8 bot">
<div id="inside" class="row row-left">
<?php if(have_posts()) :
$count = 0;
while(have_posts()) : the_post(); ?>
<div class="col-xs-8 col-box2">
<a href="#myModal-<? the_ID(); ?>" data-toggle="modal" ><?php the_post_thumbnail('thumbnail'); ?></a>
</div>
<?php if($count==2) :
echo '</div>';
echo '<div id="inside" class="row row-left">';
endif;
$count++; endwhile;
endif;
wp_reset_postdata();
?>
</div>
</div>
</div>
這裏是我的模式:
<div id="myModal-<? the_ID(); ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<h3 id="myModalLabel">
<?php the_title();?>
</h3>
<p>
<?php the_content();?>
</p>
</div>
<div class="modal-body">
<?php the_post_thumbnail(); ?>
</div>
<div class="modal-footer">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
</div>