admin管理员组文章数量:1022727
I am adding an image gallery via wp media uploader. In the frontend, I am trying to show these images in Thickbox pop-up. However, it shows the images in pop-up but when I navigate [next and prev images] it suddenly works and an error is seen in the console.
This is the error: .jpg&width=753&height=470?random=1555568706302 404 (Not Found). If I paste this url, 404 page is seen.
All in all, the navigation buttons are not working properly. If I add 2 images in gallery, the next button box works but prev button throws error. If I use more than 2 images, the next disappears after second images and prev button fails as well.
This is my code for front-end where images are displayed:
<?php
foreach ($ids as $key => $value):
$image_medium = wp_get_attachment_image_src($value, 'medium');
$image_full = wp_get_attachment_image_src($value, 'full');
$attachment_title = get_the_title($value);
?>
<li>
<a rel="gallery" href="<?php echo esc_url($image_full[0]); ?>">
<img class="guide-gallery-image" alt="<?php echo esc_attr($attachment_title); ?>" src="<?php echo esc_url($image_medium[0]); ?>" />
</a>
</li>
<?php
endforeach; ?>
This is how I have added thickbox()
resources (css and js) in my footer:
<?php
add_thickbox();
get_footer();
?>
I am adding an image gallery via wp media uploader. In the frontend, I am trying to show these images in Thickbox pop-up. However, it shows the images in pop-up but when I navigate [next and prev images] it suddenly works and an error is seen in the console.
This is the error: .jpg&width=753&height=470?random=1555568706302 404 (Not Found). If I paste this url, 404 page is seen.
All in all, the navigation buttons are not working properly. If I add 2 images in gallery, the next button box works but prev button throws error. If I use more than 2 images, the next disappears after second images and prev button fails as well.
This is my code for front-end where images are displayed:
<?php
foreach ($ids as $key => $value):
$image_medium = wp_get_attachment_image_src($value, 'medium');
$image_full = wp_get_attachment_image_src($value, 'full');
$attachment_title = get_the_title($value);
?>
<li>
<a rel="gallery" href="<?php echo esc_url($image_full[0]); ?>">
<img class="guide-gallery-image" alt="<?php echo esc_attr($attachment_title); ?>" src="<?php echo esc_url($image_medium[0]); ?>" />
</a>
</li>
<?php
endforeach; ?>
This is how I have added thickbox()
resources (css and js) in my footer:
<?php
add_thickbox();
get_footer();
?>
本文标签: pluginsWordPress Thickbox Navigation Issue in Gallery
版权声明:本文标题:plugins - WordPress Thickbox Navigation Issue in Gallery 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745577614a2157117.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论