- This topic has 9 replies, 3 voices, and was last updated 5 years, 5 months ago by Tom.
-
AuthorPosts
-
November 9, 2018 at 10:59 am #723218dasigna
hi there,
so i am searching quite a while to get a solution for this with no luck:
the post image in single view originally has no link to it… how can i add one to the media-file to show the image in a lightbox??
currently havin relatively small post images with fixed ratio, so i nedd to have a way to open them up in native elementor lightbox.any hint somebody?
thanks in advance
November 9, 2018 at 2:18 pm #723323DavidStaffCustomer SupportHi there,
can you provide a link to the site so i can see the actual setup. I am not sure if its gonna be doable using the Elementor lightbox….
November 10, 2018 at 4:16 am #723605dasignahi david,
link currently would be useless because its a dev-site.
but what do you mean by ‘actual setup’?
i think the blog post setup for single is always quite the same regardless of setup…?so let me explain another way:
every blog post has its featured image – normally they contain a link to the specific post until the single view… then the image finally has no link at all.
so the question is – is there a way to give the image a link to the media file (in single view) so the lightbox can grab this? the latter is no problem as the lightbox grabs all links from images set to media file.better to understand now??
regards
November 10, 2018 at 9:23 am #723944TomLead DeveloperLead DeveloperHi there,
This depends. Are you using the Blog module at all? If so, are you resizing the image at all with the Customizer options?
November 10, 2018 at 12:03 pm #724008dasignahi tom,
yes, using blog module.
yes, also resizing the image to equal width/height.do you need more information?
November 10, 2018 at 5:24 pm #724123TomLead DeveloperLead DeveloperNovember 11, 2018 at 9:11 am #724608dasignahi tom,
thanks for the partly great solution – works in principle, but only for a static custom link. but how do i get the mediafile link dynamically inserted for the respective single featured image?
… replacing the “#YOUR-URL” part with the link to the full image from each single post?November 11, 2018 at 6:40 pm #724827TomLead DeveloperLead DeveloperIn that case, you would do this:
add_filter( 'generate_single_featured_image_output', function( $output, $image_html ) { printf( '<div class="featured-image"> <a href="%1$s"> %2$s </a> </div>', get_the_post_thumbnail_url(), $image_html ); }, 10, 2 );
November 12, 2018 at 1:48 am #724989dasignathank you tom. tried quite a time to tweak but only got white screens ๐
this works flawlessly!really appreciate your support.
November 12, 2018 at 8:08 am #725384TomLead DeveloperLead DeveloperNo problem – glad I could help! ๐
-
AuthorPosts
- You must be logged in to reply to this topic.