gpt4 book ai didi

php - Wordpress 主题灯箱缩略图

转载 作者:行者123 更新时间:2023-11-28 05:53:07 24 4
gpt4 key购买 nike

所以,我基本上在我的 wordpress 主题中有这段代码,它为图库中的图像创建一个容器,该容器顶部有 2 个图标作为覆盖。第一个图标是我感兴趣的灯箱图库图标,另一个是点赞按钮。

我想做的是消除灯箱等按钮,让整个缩略图使用灯箱而不是重定向到元素页面。

我曾尝试更改链接到元素页面的图像的 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:
?>

最佳答案

我不确定您的主题的其余部分是什么样的,但我正在尝试一下。我认为触发灯箱和决定在灯箱中查看哪个图像的代码是:

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:
?>

关于php - Wordpress 主题灯箱缩略图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37215758/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com