0
できるだけシンプルにWordPressテーマを作成しようとしましたが、なぜ高度なカスタムフィールドから画像を表示できないのかわかりませんFeatherlight.jsを使用してモーダルボックスは、(http://noelboss.github.io/featherlight/)Wordpress - Featherlight.jsを使用してモーダルボックスでアドバンストカスタムフィールド画像を開く
こここれは、単純に画像のカスタムフィールド
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php
$image = get_field('image');
if(!empty($image)): ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
を表示私のsingle.phpコード、である私のオンラインページhttp://www.skuar.com
であり、これはありますwpループc私はちょうどライトボックスに画像を開きたいontent
<div id="post">
<a href ="<?php the_permalink(); ?>">
<div class="img" href="<?php
$image = get_field('image');
if(!empty($image)): ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endif; ?>" data-featherlight="image">
<?php
$image = get_field('image');
if(!empty($image)): ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endif; ?>
</div>
</a>
</div>
... は理にかなっていますか?
ありがとうございます!
素晴らしいです。それは私の問題を解決した。しかし、実際には非常に奇妙ですが、私のローカルサーバー(MAMPを使用しています)ではうまく動作しますが、オンラインでは動作しません。私はまったく同じファイルをアップロードしました。なぜなのかご存知ですか? – levystore
ライブで働いていますか? – vel
これですべてがうまくいきました。私は/ js /と置き換えます... by mydomain.com/js/... – levystore