Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Copa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Como adicionar uma galeria no WordPress com um efeito Lightbox

Nota editorial: Ganhamos uma comissão de links de parceiros no WPBeginner. As comissões não afetam as opiniões ou avaliações de nossos editores. Saiba mais sobre Processo editorial.

Deseja adicionar uma galeria no WordPress com um efeito de lightbox?

O efeito lightbox permitirá que os usuários visualizem suas imagens em um ambiente livre de distrações, sem sair do site. No entanto, o bloco de galeria padrão do WordPress não oferece suporte a lightboxes.

Neste artigo, mostraremos como adicionar facilmente uma galeria no WordPress com um efeito lightbox, passo a passo.

Add a Gallery in WordPress with a Lightbox Effect

Por que adicionar o efeito Lightbox nas galerias do WordPress?

Ao adicionar um efeito de lightbox responsivo às galerias do seu site WordPress, você pode exibir suas imagens de uma forma mais profissional. Esse efeito permite exibir suas fotos em uma janela pop-up em seu site quando um usuário clica nelas.

As lightboxes ajudam a criar uma experiência de visualização mais imersiva para seus visitantes e até mesmo facilitam o compartilhamento de suas imagens nas mídias sociais ou o download delas em seus computadores.

Lightbox preview

Se você tiver um site de fotografia, adicionar um efeito de lightbox permitirá que os usuários visualizem suas imagens de alta resolução em um modo livre de distrações, aumentando o envolvimento.

Da mesma forma, se você tiver uma loja WooCommerce, adicionar um efeito de lightbox às galerias de produtos pode ajudar os clientes a ver o produto de perto e tomar uma decisão informada.

Dito isso, vamos ver como adicionar facilmente uma galeria de imagens do WordPress com um efeito lightbox, passo a passo.

Como adicionar uma galeria do WordPress com um efeito Lightbox

Você pode adicionar facilmente uma galeria do WordPress com um efeito lightbox usando a Envira Gallery.

É o melhor plug-in de galeria do WordPress que permite criar galerias de imagens modernas e totalmente responsivas para o seu site.

O Envira Gallery também é super rápido e tem um construtor do tipo arrastar e soltar, modelos de galerias profissionais e muitos recursos, incluindo a adição de tags, áudio, compartilhamento social e lightboxes.

Primeiro, você precisa instalar e ativar o plug-in Envira Gallery. Para obter instruções detalhadas, consulte nosso guia passo a passo sobre como instalar um plug-in do WordPress.

Observação: A Envira Gallery também tem um plug-in gratuito que você pode usar para este tutorial. No entanto, o upgrade para o plano pago lhe dará acesso a mais recursos.

Após a ativação, visite a página Envira Gallery ” Configurações na barra lateral de administração do WordPress para inserir a chave de licença.

Você pode obter essas informações em sua conta no site da Envira Gallery.

Add the Envira Gallery license key

Depois disso, visite a página Envira Gallery ” Add New no painel do WordPress para começar a criar sua própria galeria.

A partir daí, digite um título para a galeria de imagens. Em seguida, clique no botão “Select Files from Your Computer” (Selecionar arquivos do seu computador) para carregar imagens. Ou, se quiser adicionar imagens da biblioteca de mídia à sua galeria, clique no botão “Select Files from Other Sources” (Selecionar arquivos de outras fontes).

Isso abrirá a biblioteca de mídia de onde você pode carregar as imagens da galeria. Lembre-se de que só é possível carregar uma imagem da biblioteca de mídia por vez.

Add images to the gallery

Depois de fazer isso, role para baixo até a seção “Currently in your Gallery”. Aqui, você verá uma visualização da sua galeria à direita com as configurações na coluna da esquerda.

Agora, clique no ícone de lápis na parte superior de cada imagem para abrir o prompt “Edit Metadata” (Editar metadados) na tela.

Click the pencil icon to open the Edit Metadata screen

A partir daqui, você pode adicionar a legenda, o status, o título e o texto alternativo para imagens individuais.

Depois disso, não se esqueça de clicar no botão “Save Metadata” (Salvar metadados) para armazenar suas configurações.

Configure image metadata

Em seguida, vá para a guia “Configuration” (Configuração) na coluna da esquerda para alterar o layout da galeria de acordo com sua preferência. Aqui, você pode selecionar um layout, o número de colunas, o tamanho da imagem, as dimensões, os temas e muito mais.

Para obter instruções detalhadas, consulte nosso guia para iniciantes sobre como criar uma galeria de imagens no WordPress.

Configure gallery layout

Depois de fazer isso, vá para a guia “Lightbox” na coluna da esquerda e marque a opção “Enable Lightbox?” (Ativar Lightbox?).

Depois disso, selecione um tema de lightbox no menu suspenso “Gallery Lightbox Theme”. Se você escolher a opção “Legacy”, o prompt do efeito de lightbox terá um layout mais antigo.

Ao escolher a opção “Base (Dark)”, o prompt da lightbox terá uma base escura como layout.

Enable the lightbox option

Em seguida, você deve selecionar se deseja exibir o título da imagem ou sua legenda no prompt da lightbox. Você também pode exibir ambos ou nenhum deles, se desejar.

Depois de fazer isso, escolha o tamanho da imagem para a lightbox no menu suspenso.

Configure image title and size for the gallery

Depois disso, marque a opção “Enable Gallery Arrows” (Ativar setas da galeria). O prompt da lightbox agora mostrará duas setas que os visualizadores podem usar para alternar para diferentes imagens em sua galeria.

Você também pode definir outras configurações para sua lightbox, inclusive o efeito de transição, o efeito de abrir/fechar, ativar o superdimensionamento da lightbox e muito mais.

Quando terminar, não se esqueça de clicar no botão “Publish” (Publicar) na parte superior para armazenar suas alterações.

Configure other lightbox options in Envira Gallery

Para adicionar sua galeria de imagens a uma página/post do WordPress, abra a página no editor de blocos.

Aqui, você precisa clicar no botão “+” de adicionar bloco no canto superior esquerdo da tela para abrir o menu de blocos. Em seguida, adicione o bloco Envira Gallery à página/post.

Add the Envira Gallery block

Depois disso, selecione a galeria de imagens que você acabou de criar no menu suspenso do próprio bloco. Por fim, clique no botão “Update” (Atualizar) ou “Publish” (Publicar) para armazenar suas configurações.

Agora, você pode visitar seu blog do WordPress para visualizar a galeria de imagens e clicar em qualquer imagem para ver o efeito de lightbox.

Lightbox effect gif

Alternativa: Use a NextGen Gallery para criar portfólios e galerias de imagens no WordPress

A Envira Gallery é a melhor opção para adicionar imagens lightbox ao seu site WordPress. Como alternativa, você pode usar a NextGEN Gallery para criar galerias e portfólios totalmente responsivos e visualmente agradáveis em seu site WordPress.

O NextGEN Gallery é a melhor alternativa ao Envira Gallery porque oferece suporte a uma ampla variedade de tipos de galerias, possui recursos relacionados ao comércio eletrônico e permite adicionar marcas d’água, caixas de luz, comentários de imagens e muito mais.

Além disso, a NextGEN Gallery permite que você aceite pagamentos on-line via Stripe ou PayPal, facilitando a venda de suas imagens on-line.

NextGen Gallery

É um plug-in de galeria avançado com recursos para fotógrafos profissionais, designers gráficos e artistas visuais, o que o torna um dos melhores plug-ins de portfólio do WordPress no mercado.

Para obter instruções detalhadas, consulte nosso tutorial sobre como adicionar um portfólio ao seu site WordPress.

Esperamos que este artigo tenha ajudado você a aprender como adicionar facilmente uma galeria do WordPress com um efeito lightbox. Talvez você também queira ver nosso guia para iniciantes sobre como fazer a edição básica de imagens no WordPress e nossas escolhas de especialistas sobre as melhores ferramentas para criar imagens melhores para as publicações do seu blog.

Se você gostou deste artigo, inscreva-se em nosso canal do YouTube para receber tutoriais em vídeo sobre o WordPress. Você também pode nos encontrar no Twitter e no Facebook.

Divulgação: Nosso conteúdo é apoiado pelo leitor. Isso significa que, se você clicar em alguns de nossos links, poderemos receber uma comissão. Veja como o WPBeginner é financiado, por que isso é importante e como você pode nos apoiar. Aqui está nosso processo editorial.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

O kit de ferramentas definitivo WordPress

Obtenha acesso GRATUITO ao nosso kit de ferramentas - uma coleção de produtos e recursos relacionados ao WordPress que todo profissional deve ter!

Reader Interactions

44 ComentáriosDeixe uma resposta

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    Thanks for recommending Envira Gallery. I make websites on Elementor, and apart from Elemenotr, I only knew NextGen gallery, which does not completely meet my requirements. I will definitely give the plugin a try and probably replace the NextGen Gallery I’ve been using with it.

  3. Ahmed Omar says

    thank you for the post, but here a question would it make difference if I used Using the WordPress Block Editor to add photo gallery than using Envira ?

  4. Sandeep Singh says

    I am really Thankful for the suggestion to add Lightbox effect to the gallery. I really appretiate such kind of support and hope same for the future.

  5. Mike says

    Hello,

    This is great, one question though is there a plugin or anything that is out there to make the gallery into a slideshow. For example say the first attached images shows up large and below are the thumbs of all the image in the gallery and you can click on a image to change the large image rather than a lightbox effect.

    Thanks,

    Mike

  6. Emma Beatty Howells says

    Thanks for a great solution I am new to all this and am trying to work out the easiest way to manage photogalleries on line – this keeps it simple and elegant! Something else I found useful was an App that watermarks photos with the minimum of fuss… ‘ImageBucket’.

  7. Michael says

    Seems easy enough. Is there a way to have captions under each picture? Also, when it opens to a lightbox, is there a way to have descriptive text in the lightbox with the image?

  8. Alex says

    I have a banner at the top of my website which displays a picture. When it opens the lightbox, the banner still appears over it. Is there any way, a code or something, which will stop this?

    Thanks
    Alex

  9. JulieBozza says

    This is a really cool solution, thank you! So much quicker and neater than what I was doing…
     
    Is there a way, however, to choose which of the images appears as the main thumbnail? That is, the thumbnail that appears in the ‘feed’ before you open up the individual post.
     
    Thank you in anticipation!

    • wpbeginner says

       @JulieBozza The thumbnail for the post is selected by using Featured Image feature. In your post editor, look at the right hand side, below publish button there should be a box in that line called Featured image.

      • JulieBozza says

         @wpbeginner Hello! Thanks for the reply. Unfortunately when I do that, it changes the banner image, but has no effect on the thumbnail in the post. I’m using the Twenty Eleven WordPress theme, so perhaps it’s giving the banner the priority, as it were.

  10. wpbeginner says

    @ukdazza The problem is with your site rather than this plugin. jQuery issues like these are very common. There is another jQuery that is causing this plugin to not work. You would have to change positions of the other jQuery code.

    This is a game of trial and error when you encounter problems like these.

  11. ukdazza says

    I’m having a problem where we’re using slickr flickr plugin to create thumbnail galleries with lightbox features. However the lightbox isn’t working at all. According to the notes I can find online about this kind of problem with this plugin, it is likely there is more than one lightbox or more than one jQuery running – causing it to not run properly.

    Lightbox doesn’t work. If you click a thumbnail it opens the image in the browser, which is rubbish.

    Any ideas? I hoped you or someone might have an idea because I tried to install this plugin and it said the destination was already taken.

  12. TGA says

    Wow. Thank you SO much. I was using NextGEN gallery, but wasn’t allowed to let my client have galleries with thumbnails of various sizes. (Dumb). So I realized using the native gallery that would be possible, but then Highslide wouldn’t create a thumbnail viewer like it would with NextGEN. Point being, this was a lifesaver! It may not be perfect, but it’s A solution and now I can move on with the project!

  13. TejSanusi✔ says

    Is there anyway to create a lightbox gallery that is enabled from one thumbnail. When the user clicks on the thumbnail, the lightbox is created, with a series of gallery images?

  14. Chris says

    Thanks for the great writeup. I found this extremely useful. I do have a question though. What if I had a pretty large gallery of about 40 or 50 pics and I only wanted one of them displayed in the post and then when someone clicks on it they’d be able to scroll through the entire gallery? Is this possible? I’d rather not have all 40 pics displayed in my post and I think this would be useful.

    Thanks!

  15. Mike Roberts says

    I am an artist and illustrator and I continue to be disappointed by the options for displaying a gallery of images in WordPress. I live in hope that, sometime soon, some bright coder will answer my plea!

  16. Gretchen says

    I didn’t realize how hard it was to find a lightbox plugin that used the native WordPress gallery function until I started looking for one! I ended up with http://wordpress.org/extend/plugins/lightbox-plus/ because of its ability to specify via shortcode in each post/page gallery whether it was to use the lightbox setting or not. I actually like to use the attachment pages sometimes, and needed a lightbox plugin that would allow me to choose when to use it. I’d be curious to hear if anyone else has found another lightbox plugin with that feature.

  17. Bronson says

    Thanks for the information.

    It’s great to be able to apply the lightbox effect to native galleries trather than having to go and manually recreate them.

    • Editorial Staff says

      No you don’t need to lightbox class every image on the gallery. It automatically does that for all images in the gallery. The class should be added on any other image that you have aside from the gallery..

      Administrador

Deixe uma resposta

Obrigado por deixar um comentário. Lembre-se de que todos os comentários são moderados de acordo com nossos política de comentários, e seu endereço de e-mail NÃO será publicado. NÃO use palavras-chave no campo do nome. Vamos ter uma conversa pessoal e significativa.