2016-05-13 40 views
0

所以,我基本上有我的wordpress主題中的這段代碼,它創建了一個圖庫的容器,該圖庫的頂部有2個圖標作爲覆蓋。第一個圖標是lightbox gallery圖標,這是我感興趣的圖標,另一個是類似按鈕。WordPress的主題燈箱縮圖

我想要做的是消除燈箱和類似的按鈕,並讓整個縮略圖使用燈箱,而不是重定向到項目頁面。

我試過改變鏈接到項目頁面的圖片的href,以加載燈箱,而不是失敗。

如果您有任何想法如何做到這一點,請讓我知道!

$html .=" " . $masonry_size; 
      $html .="'>"; 

      $html .= "<div class='image_holder'>"; 
      $html .= "<a class='portfolio_link_for_touch' href='".$portfolio_link."' target='".$target."'>"; 
      $html .= "<span class='image'>"; 
      $html .= get_the_post_thumbnail(get_the_ID(), $image_size); 
      $html .= "</span>"; //close span.image 
      $html .= "</a>"; //close a.portfolio_link_for_touch 

      $html .= "<span class='text_holder'>"; 
      $html .= "<span class='text_outer'>"; 
      $html .= "<span class='text_inner'>"; 
      $html .= '<div class="hover_feature_holder_title">'; 
      $html .= '<div class="hover_feature_holder_title_inner">'; 
      $html .= '<'.$title_tag.' '.$title_styles.' class="portfolio_title"><a href="' . $portfolio_link . '" '.$title_styles.' target="'.$target.'">' . get_the_title() . '</a></'.$title_tag.'>'; 
      $html .= $separator_html; 
      $html .= '<span '.$category_style.' class="project_category">'; 
      $k = 1; 
      foreach ($terms as $term) { 
       $html .= "$term->name"; 
       if (count($terms) != $k) { 
        $html .= ', '; 
       } 
       $k++; 
      } 
      $html .= '</span>'; //close span.project_category 
      $html .= '</div>'; //close div.hover_feature_holder_title_inner 
      $html .= '</div>'; //close div.hover_feature_holder_title 

      $html .= "<span class='feature_holder'>"; 
      $html .= '<span class="feature_holder_icons">'; 
      if ($lightbox == "yes") { 
       $html .= "<a class='lightbox hover_icon_holder' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'><span ".$features_icons_styles." class='hover_icon icon_search'></span></a>"; 
      } 
      $html .= "<a class='preview hover_icon_holder' href='" . $portfolio_link . "' target='".$target."'><span ".$features_icons_styles." class='hover_icon icon_link_alt'></span></a>"; 
      if ($portfolio_qode_like == "on") { 
       $html .= "<span ".$features_icons_styles." class='portfolio_like hover_icon_holder'>"; 

       if (function_exists('qode_like_portfolio_list')) { 
        $html .= qode_like_portfolio_list(get_the_ID()); 
       } 
       $html .= "</span>"; 
      } 
      $html .= "</span>"; //close span.feature_holder_icons 
      $html .= "</span>"; //close span.feature_holder 

      $html .= "</span>"; //close span.text_inner 
      $html .= "</span>"; //close span.text_outer 
      $html .= "</span>"; //close span.text_holder 
      $html .= "</div>"; //close div.image_holder 
      $html .= "</article>"; 

     endwhile; 
     else: 
      ?> 

回答

0

我不確定你的主題的其餘部分是什麼樣子,但我在這裏試一試。我認爲是觸發燈箱和決定哪些圖像以查看收藏夾代碼:

class='lightbox hover_icon_holder' title='" . $title . "' href='" . $large_image . "' data-rel='prettyPhoto[" . $slug_list_ . "]'

那麼,我們可以移動這部分代碼的外鏈環。我也從代碼中刪除了這兩個按鈕。我認爲它是這樣的:

$html .=" " . $masonry_size; 
     $html .="'>"; 

     $html .= "<div class='image_holder'>"; 
     $html .= "<a class='portfolio_link_for_touch lightbox' href='".$large_image."' data-rel='prettyPhoto[" . $slug_list_ . "]' target='".$target."'>"; 
     $html .= "<span class='image'>"; 
     $html .= get_the_post_thumbnail(get_the_ID(), $image_size); 
     $html .= "</span>"; //close span.image 
     $html .= "</a>"; //close a.portfolio_link_for_touch 

     $html .= "<span class='text_holder'>"; 
     $html .= "<span class='text_outer'>"; 
     $html .= "<span class='text_inner'>"; 
     $html .= '<div class="hover_feature_holder_title">'; 
     $html .= '<div class="hover_feature_holder_title_inner">'; 
     $html .= '<'.$title_tag.' '.$title_styles.' class="portfolio_title"><a href="' . $portfolio_link . '" '.$title_styles.' target="'.$target.'">' . get_the_title() . '</a></'.$title_tag.'>'; 
     $html .= $separator_html; 
     $html .= '<span '.$category_style.' class="project_category">'; 
     $k = 1; 
     foreach ($terms as $term) { 
      $html .= "$term->name"; 
      if (count($terms) != $k) { 
       $html .= ', '; 
      } 
      $k++; 
     } 
     $html .= '</span>'; //close span.project_category 
     $html .= '</div>'; //close div.hover_feature_holder_title_inner 
     $html .= '</div>'; //close div.hover_feature_holder_title 

     $html .= "</span>"; //close span.text_inner 
     $html .= "</span>"; //close span.text_outer 
     $html .= "</span>"; //close span.text_holder 
     $html .= "</div>"; //close div.image_holder 
     $html .= "</article>"; 

    endwhile; 
    else: 
     ?>