-
AuthorPosts
-
January 30, 2015 at 9:26 am #195272
That’s great working much better now thank you. Just to double check was there a way to enable thumbnail and arrow key navigation?
Many thanks!January 30, 2015 at 11:26 am #195370Hey there,
I’m sorry, we don’t support the keyboard navigation. It could be possible with custom development, however this would be outside the scope of support we can offer.
January 30, 2015 at 12:29 pm #195412Not to worry, cheers for the help!
January 30, 2015 at 1:05 pm #195436You’re welcome!
February 5, 2015 at 5:04 pm #200070This reply has been marked as private.February 6, 2015 at 6:42 am #200414Hi Tim,
Instead of the above provided codes, simply insert following code in your child theme’s functions.php file:
// Liking Portfolio Items to Featured Image URL to Open Them in a Lightbox // ============================================================================= add_filter( 'post_type_link', 'x_remap_portfolio_to_page', 10, 4); function x_remap_portfolio_to_page($post_link, $post, $leavename, $sample) { if ( 'x-portfolio' == $post->post_type ) { return $image_link = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); } return $post_link; } add_action('wp_footer', 'enqueue_lightbox_script'); function enqueue_lightbox_script() { echo ' <script type="text/javascript" src="' . home_url() . '/wp-content/plugins/x-shortcodes/js/dist/site/vendor-ilightbox.min.js"></script> <script>jQuery(document).ready(function($) { $(\'.page-template-template-layout-portfolio .entry-featured .entry-thumb\').click(function(e) { e.preventDefault(); }); }); jQuery(document).ready(function(){jQuery(".x-portfolio .entry-title a").iLightBox({skin: "light",linkId: "gallery-image",overlay: {opacity: 0.875,blur: true},styles: {prevScale: 0.75,prevOpacity: 0.75,nextScale: 0.75,nextOpacity: 0.75},path: "horizontal",controls: {thumbnail: false}});}); </script>'; }
If you have made any changes provided in our earlier responses of this thread, please remove them. The provided code will only open the images inside the lightbox on portfolio page. The portfolio items on your homepage are inserted using recent posts shortcodes. If you wish to make those items open in an lightbox, it will require additional customization to the portfolio items. Unfortunately we cannot assist you with that. You may wish to consult a developer to assist you with this.
Thank you.
February 6, 2015 at 1:59 pm #200674Hello X,
This works like a charm! Thanks so much. I’m getting happy working with X!
February 7, 2015 at 4:06 am #201016You’re welcome.
February 14, 2015 at 10:07 am #206608Hi,
I’m implementing the above code (#200414) and I’m wondering if it’s possible to modify it slightly so as to avoid the misleading title “Permalink to: ” on my portfolio thumbnails.Would it be also possible to pass the title of the featured image to the lightbox caption?
Many thanks for any help you can provide.February 15, 2015 at 2:23 pm #207119Hi there,
The change is applied indirectly from the templates. Rather just an enhancement through functions.php. The answer is not possible through that coding.
It’s possible by custom development, you may consult it to a developer.
Thanks!
February 16, 2015 at 7:40 am #207596Thanks for getting back to me and it’s thanks to your suggestion I managed to get it working.
February 16, 2015 at 10:46 am #207747You’re welcome! 🙂
March 24, 2015 at 6:01 am #233963This reply has been marked as private.March 24, 2015 at 10:33 am #234148Hi @thomasmcalister,
Upon checking your website, I can see that the lightbox images work fine on my end.
Please take a look at the screenshot: http://c2n.me/3eO6Ii6
Try to clear your browser & plugin cache also.
Thanks.June 16, 2015 at 8:52 am #303498This reply has been marked as private. -
AuthorPosts