WordPress has never had lightbox functionality built-in.
Perhaps it was provided by one of your plugins, or your theme at one time?
There are a few plugins you can choose from for this: https://wordpress.org/plugins/search/lightbox/
Thread Starter
Asome
(@asome)
I know. I installed Responsive Lightbox but the pictures do not open.
In that case, I recommend reporting the problem at https://wordpress.org/support/plugin/responsive-lightbox-lite/ so the plugin’s developers and support community can help you with this.
Thread Starter
Asome
(@asome)
Thanks! But other Lightbox apps do not work. What needs to be done to open a picture using Lightbox? Maybe I forgot about some settings for each picture? I am using Gutenberg.
You’ll need to speak with support for the plugin you want to use.
WordPress doesn’t provide lightbox functionality, so if something isn’t working with that, it would be up to the plugin.
Thread Starter
Asome
(@asome)
Thanks! I will try some more plugins.
@macmanx Hi. I’m completely new here. Sorry for writing it here, but i search EVERYWHERE on how can i create new topic in this wordpress forum and i couldn’t find information. Please help me.
@kewlak Choose any forum, like https://wordpress.org/support/forum/how-to-and-troubleshooting/ and you’ll find a “Create Topic” button at the top.
@macmanx Thank you. I went to Views -> All topics. That’s why i couldn’t find it there.
-
This reply was modified 6 years, 2 months ago by
kewlak.
Thread Starter
Asome
(@asome)
I found a solution to the problem:
## делает IMG тег анкором ссылки на картинку указанную в этом теге, чтобы её можно было увеличить и посмотреть.
add_filter( 'the_content', function( $content ){
// пропускаем если в тексте нет картинок вообще...
if( false === strpos( $content, '<img ') )
return $content;
if( ! is_main_query() || ! in_array( $GLOBALS['post']->post_type, ['post'] ) )
return $content;
$img_ex = '<img[^>]*src *= *["\']([^\'"]+)["\'][^>]*>';
$content = preg_replace_callback( "~(?:<a[^>]+>\s*)$img_ex|($img_ex)~", function($mm){
// пропускаем, если картинка уже со ссылкой
if( empty($mm[2]) )
return $mm[0];
return '<a href="'. $mm[3] .'">'. $mm[2] .'</a>';
}, $content );
return $content;
}, 5 );
Origin