0

ページにあるこの href はサイクル 2 スライダーに含まれているため、画像の下にキャプションが表示されます。ただし、クリックして新しいタブを開くと機能しません。右クリックしてから「...に移動」をクリックした場合にのみ機能します。誰かが理由を知っていますか?

wordpress のプラグイン: http://www.advancedcustomfields.com/

コード: <a class="alt-caption" href="http://<?php the_field('url_site'); ?>"><?php the_field('url_site'); ?></a>

      <div class="paginawrap no_overflow">
        <div class="wraptest">
          <div class="cycle-slideshow" 
               data-cycle-fx="carousel" 
               data-cycle-speed="500" 
               data-cycle-delay=5000
               data-cycle-next=" > img"
               data-cycle-caption=".alt-caption"
               data-cycle-caption-template="{{alt}}"
               data-cycle-carousel-fluid=true
               data-allow-wrap=false
          >
<?php $args = array(
        'post_type' => 'project',
        'posts_per_page' => 10
      );
        $query = new WP_Query( $args );
        if ( $query->have_posts()) :
        while ( $query->have_posts()) :  $query->the_post();
          the_post_thumbnail('home');
        endwhile; wp_reset_postdata();
        endif; ?>

         <a href=" http://<?php the_field('url_site'); ?> "> <div class="alt-caption"></div></a>
          </div>
          <div class="archief1">

          </div>
        </div>
      </div>
4

2 に答える 2

0

php を使用してリンクを読み込みます。そのコード行全体で php を使用しないのはなぜですか? このようなもの:

echo('<a class="alt-caption" href="' . $the_field . '" target="_blank"><' . $the_field . '></a>');

また、ホームページが正しく php データを読み取っていることを確認してください。

于 2014-01-28T10:17:37.837 に答える