0
私は 'ショーケース'と呼ばれるカスタムポストタイプを作って、このカスタムポストタイプでいくつかの投稿を作成しました。問題は、「製品」をクリックするとサムネイルURLに行くのではなくライトボックスに表示されることです。Wordpressのタグライトボックスのサムネイル画像をプラグインで表示
<section id="showcase">
<?php
$args = array('post_type' => 'showcase', 'posts_per_page' => -1); $the_query = new WP_Query($args);
if ($the_query->have_posts()) :
$it = 0;
while ($the_query->have_posts()) : $the_query->the_post();
$terms = get_the_terms($post->ID , 'showcase_category');
$it ++;
if ($it == 6) {
echo '</section><div class="cta-block"><h2>Live model drawing</h2><p>Drawing from a live model, gives you the opportunity to draw what you see instead of drawing what you think about.</p><a href="/kerkeni/courses/" class="cta-button">View courses</a></div><section id="showcase">';
}
?>
<a class="entry-showcase" href="<?php the_post_thumbnail_url(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail('medium'); ?>
</a>
<?php wp_reset_postdata();
endwhile; else :
endif; ?>
</section>
はまた、私は自動にJPG、GIFのなどを検出するが、何らかの理由で、彼らはサムネイル画像のために働いていないいくつかのプラグインを使用してみました:
この
は、私が使用していたコードです。いくつかのプラグインは、私がテストした:
簡単FancyBox、 応答ライトボックス、 シンプルライトボックス、また
、私はそれだけに滞在するのではなく、ストレートURL内のメディアファイルに行くすべてのエラーを取得しておりません同じページを表示し、ライトボックスにイメージを表示します。事前に
おかげで(:
<a class="entry-showcase fresco" href="<?php the_post_thumbnail_url(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail('medium'); ?>
</a>
も参照してください。