-
AuthorPosts
-
June 16, 2015 at 1:32 pm #303834
Hi there,
Thanks for writing in!
The provided code works with X Shortcode, as you are using Cornerstone, please use following code instead:
// 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/cornerstone/assets/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-featured 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>'; }
Hope this helps. 🙂
Thank you.
June 16, 2015 at 2:07 pm #303885Hi,
I’ve added the code above to the functions.php file of my child theme but still nothing happens when clicking on the portfolio items.
June 17, 2015 at 1:35 am #304379Hi,
I was able to fix it by changing .x-portfolio .entry-title a to .x-portfolio .entry-featured a
Kindly check on your end.
http://janinevanmoosel.co.uk/portfolio/
Thanks
September 29, 2015 at 2:52 am #602637Hello, I need to build portfolio with lightbox too. I read carefull instructions, but You use
<script type=”text/javascript” src=”‘ . home_url() . ‘/wp-content/plugins/x-shortcodes/js/dist/site/vendor-ilightbox.min.js”></script>
but I have not this script in my folders. How can I make lightbox without this plugin?September 29, 2015 at 3:01 am #602661Hi there,
Please load the script from following file :
wp-content/plugins/cornerstone/assets/js/dist/site/vendor-ilightbox.min.js
Thanks.
September 29, 2015 at 3:24 am #602682Thank you!
September 29, 2015 at 3:30 am #602697You’re welcome.
November 14, 2015 at 12:24 am #664835Hi
i´ve tried everything to set the portfolio items to a lightbox, as you tell in the posts step by step. no chanceusing integrity, and cannot set the lightbox
November 14, 2015 at 12:28 am #664836Hi there,
Please open a new topic and provide us with URL, login and FTP credentials.
Please provide us with a link to this thread as well.Thanks.
-
AuthorPosts