2016-05-24 44 views
1

我有一个网站,我试图用链接填充。现在,如果您从计算机上查看网站,您会看到有一个带有文本的浮动框,然后在地图上点点。如果将鼠标悬停在其中一个点上,则会显示该网站的名称以及相关的时间段。如何拉链接并放入href?

http://jeremynative.com/onthissite/

<?php 
$i = 0; 
while (have_posts()) : the_post(); 
    $et_location_lat = get_post_meta(get_the_ID(), '_et_listing_lat', true); 
    $et_location_lng = get_post_meta(get_the_ID(), '_et_listing_lng', true); 

    $et_location_rating = '<div class="location-rating"></div>'; 
    if (($et_rating = et_get_rating()) && 0 != $et_rating) 
     $et_location_rating = '<div class="location-rating"><span class="et-rating"><span style="' . sprintf('width: %dpx;', esc_attr($et_rating * 17)) . '"></span></span></div>'; 

    if ('' != $et_location_lat && '' != $et_location_lng) { 
?> 




      et_add_marker(<?php printf('%1$d, %2$s, %3$s, \'<div id="et_marker_%1$d" class="et_marker_info"><div class="location-description"> <div class="location-title"> <h2>%4$s </h2> <div class="listing-info"><p>%5$s</p></div> </div> ' . $et_location_rating . ' </div> <!-- .location-description --> </div> <!-- .et_marker_info -->\'', 
       $i, 
       esc_html($et_location_lat), 
       esc_html($et_location_lng), 
       get_the_title(), 
       wp_strip_all_tags(addslashes(get_the_term_list(get_the_ID(), 'listing_type', '', ', '))) 
      ); ?>); 
<?php 
    } 

    $i++; 
endwhile; 

rewind_posts(); 
?> 
+0

而问题是什么? –

+0

如何将链接复制到每个引脚悬停图标的页面? –

+0

例如,你去了该网站,它显示在左上角的印度岛网站上作为标题,你可以点击它去阅读更多。我想尝试将链接复制到悬停框,以便移动用户可以在没有大悬停框的情况下进行导航。 –

回答

0

尝试用

<?php 
$i = 0; 
while (have_posts()) : the_post(); 
    $et_location_lat = get_post_meta(get_the_ID(), '_et_listing_lat', true); 
    $et_location_lng = get_post_meta(get_the_ID(), '_et_listing_lng', true); 

    $et_location_rating = '<div class="location-rating"></div>'; 
    if (($et_rating = et_get_rating()) && 0 != $et_rating) 
     $et_location_rating = '<div class="location-rating"><span class="et-rating"><span style="' . sprintf('width: %dpx;', esc_attr($et_rating * 17)) . '"></span></span></div>'; 

    if ('' != $et_location_lat && '' != $et_location_lng) { 
?> 
     et_add_marker(<?php printf('%1$d, %2$s, %3$s, \'<div id="et_marker_%1$d" class="et_marker_info"><div class="location-description"> <div class="location-title"><h2><a href="%6$s">%4$s</a></h2><div class="listing-info"><p>%5$s</p></div> </div> ' . $et_location_rating . ' </div> <!-- .location-description --> </div> <!-- .et_marker_info -->\'', 
       $i, 
       esc_html($et_location_lat), 
       esc_html($et_location_lng), 
       get_the_title(), 
       wp_strip_all_tags(addslashes(get_the_term_list(get_the_ID(), 'listing_type', '', ', '))), 
       get_the_permalink() 
      ); ?>); 
<?php 
    } 

    $i++; 
endwhile; 

rewind_posts(); 
?> 

我加了标题里面的链接,然后用get_the_permalink()功能拉在固定链接。