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

Jak dodawać i wyrównywać obrazki w edytorze bloków WordPress (Gutenberg)

Kiedy po raz pierwszy przeszliśmy na edytor bloków WordPress, nawet proste zadania, takie jak dodawanie i wyrównywanie obrazków, wydawały się inne.

Pomagając tak wielu użytkownikom za pośrednictwem WPBeginner, powiadomiliśmy, że jest to jedna z najczęstszych przeszkód, z jakimi borykają się ludzie podczas przechodzenia na Gutenberga.

Dobrą wiadomością jest to, że praca z obrazkami w edytorze bloków stała się bardziej intuicyjna – gdy już wiesz, gdzie szukać.

W tym przewodniku pokażemy dokładnie, jak dodawać i wyrównywać obrazki w edytorze bloków WordPress. Są to te same techniki, których używamy codziennie na WPBeginner, wyjaśnione w prosty sposób, który każdy może naśladować.

Adding and properly aligning images in WordPress

Wyrównanie obrazu w edytorze WordPress

Wcześniej WordPress używał obszaru tekstowego z przyciskami edycji jako domyślnego edytora. Jednym ze szczególnych problemów w starym edytorze było wyrównanie obrazów, co mogło utrudniać prawidłowe ułożenie elementów na stronie WordPress.

Mimo że istniały opcje wyrównania obrazów do lewej, prawej lub środka, nie zawsze wyglądały one dobrze. Czasami obrazy nie były wyrównane, nie miały dokładnego rozmiaru lub po prostu wyglądały dziwnie.

WordPress 5.0 wprowadził nowy edytor wpisów WordPress o nazwie edytor bloków Gutenberg. Naprawiono w nim kilka problemów ze starym edytorem, w tym problemy z wyrównaniem obrazków.

W poniższych sekcjach wyjaśnimy, jak łatwo dodawać i wyrównywać obrazy w nowym edytorze, aby tworzyć piękne układy postów i stron na blogu WordPress. Oto krótki przegląd wszystkich tematów, którymi się podzielimy:

Zaczynajmy!

Jak dodawać i wyrównywać obrazy w WordPress?

Edytor zawiera następujące bloki, które można wykorzystać do dodawania obrazów do postów i stron WordPress:

  • Imagely
  • Inline Image
  • Galeria
  • Media i tekst
  • Okładka

Zacznijmy najpierw od prostego bloku obrazków.

Możesz kliknąć przycisk “Dodaj nowy blok” lub wpisać /image w edytorze postów, aby wstawić blok obrazu.

Adding a new image block in WordPress post editor

Spowoduje to aktywację 3 przycisków wewnątrz pustego bloku obrazu.

Teraz można przesłać obraz z komputera, wybrać już przesłany obraz z biblioteki multimediów lub wstawić obraz, podając adres URL pliku obrazu.

Następnie kliknij przycisk “Prześlij” i wybierz obraz, który chcesz przesłać z komputera.

Gdy tylko wybierzesz obrazek, WordPress prześle go do twoich multimediów i wstawi do bloku z obrazkami.

Adding an image using the image block

Teraz powiadomienie pojawi się na pasku narzędzi na górze twojego obrazka, a w prawej kolumnie pojawią się ustawienia bloków obrazków.

Aby wyrównać twój obrazek, użyjesz paska narzędzi, który pojawi się na górze obrazka.

Image alignment buttons in WordPress post editor

Blok obrazu udostępnia następujące opcje wyrównania obrazka jako przyciski na pasku narzędzi.

  • Brak
  • Wyrównaj do lewej
  • Wyrównaj środek
  • Wyrównaj do prawej

Kliknij przycisk “Wyrównaj do środka”, aby wyśrodkować obraz w poście.

Center align an image in WordPress

Jak idealnie wyrównać obraz obok tekstu?

Często zdarza się, że trzeba idealnie wyrównać obraz obok tekstu. Edytor bloków WordPress ułatwia to, dodając blok Media i tekst.

Blok ten zasadniczo dodaje dwukolumnowy obszar – jedną kolumnę na obrazy (media) i drugą kolumnę na zawartość tekstową.

Media and text block in WordPress post editor

Wystarczy przesłać zdjęcie, klikając przycisk “Prześlij”.

Następnie możesz dodać tekst, który chcesz wyświetlić obok niego.

Adding media and text to the block

Jeśli potrzebujesz dłuższego opisu, śmiało go wpisz.

Wyrównanie obrazka automatycznie dostosuje się do wysokości tekstu w następnej kolumnie.

Image size adjusts to align vertically

Edytor bloków WordPress zawiera również blok do dodawania galerii obrazów. Pozwala to na łatwe wyświetlanie obrazów w siatce wierszy i kolumn.

Blok Galeria zawiera podobne opcje wyrównania na pasku narzędzi. Domyślnie blok wyświetla obrazy w układzie 3-kolumnowym. Tak więc, galeria obrazów może wyglądać następująco:

A 3-column gallery

Układ galerii można dostosować, przesuwając suwak w lewo lub w prawo. Możesz też po prostu wpisać żądaną liczbę kolumn w polu.

Tutaj wypróbowaliśmy układ 4-kolumnowy:

A 4-column gallery

Jeśli galeria nie wygląda dobrze z powodu różnic w rozmiarach obrazów, należy dostosować jej wyrównanie.

W edytorze postów możesz kliknąć galerię. Następnie możesz kliknąć ikonę “Wybierz blok nadrzędny: Galeria”, aby otworzyć panel dostosowywania.

The Select parent block: Gallery icon

Z tego miejsca upewnijmy się, że włączona jest opcja “Przytnij obrazy, aby dopasować”.

Gdy tylko to zrobisz, WordPress dostosuje galerię do centrum.

Crop images to fit to make your gallery looks neat

Domyślna funkcja galerii w WordPressie jest całkiem dobra. Jeśli jednak regularnie dodajesz galerie zdjęć do swoich wpisów i stron WordPress, rozważ użycie wtyczki do galerii zdjęć, takiej jak Envira Gallery.

Te wtyczki dadzą ci więcej opcji wyrównywania obrazków w twoich galeriach zdjęć, wyświetlania ich w popupie i nadawania im różnych stylów.

Więcej szczegółów można znaleźć w naszym poradniku na temat dodawania galerii obrazów w WordPress.

Jak dodać dwa obrazy obok siebie w WordPress?

Najprostszym sposobem na wyświetlenie 2 obrazów obok siebie w poście WordPress jest dodanie obu obrazów do bloku Galeria.

Display two images side by side in WordPress posts and pages

Aby otworzyć opcję dostosowywania bloku Galeria, należy kliknąć na galerię, a następnie ponownie na ikonę “Wybierz blok nadrzędny: Galeria”.

Spowoduje to otwarcie panelu dostosowywania po prawej stronie.

Gallery block icon to open customization options

W tym miejscu wystarczy wybrać układ dwukolumnowy dla bloku galerii, aby wyświetlić oba obrazy obok siebie.

Możesz także włączyć opcję “Przytnij obrazy, aby dopasować”, aby upewnić się, że oba obrazy mają ten sam rozmiar i są wyrównane do środka.

Crop images to fit enabled

Więcej sposobów na dodawanie i wyrównywanie obrazów w WordPressie

Oprócz obrazka, multimediów i tekstu oraz bloku galerii, można również użyć bloku Okładka, aby dodać obrazek okładki.

W nowoczesnym projektowaniu stron internetowych obrazy okładek są wykorzystywane do tworzenia wysoce angażujących układów treści i wyróżniania różnych sekcji strony.

Blok obrazu okładki ma takie same opcje wyrównania jak blok obrazu. Możesz dodać tekst nad obrazem i wybrać kolor nakładki w ustawieniach bloku. Najlepsze jest to, że można zaznaczyć opcję “Naprawiono tło”, która tworzy efekt paralaksy w tle.

Cover image in WordPress

Aby dowiedzieć się więcej na temat korzystania z obrazów okładek, zapoznaj się z naszym artykułem na temat różnicy między obrazami wyróżnionymi a obrazami okładek w WordPress.

Do tej pory rozmawialiśmy o dodawaniu obrazków bezpośrednio do twoich wpisów i stron. A co z obrazkami z witryn innych firm?

Edytor bloków również to ułatwia. Możesz dodawać obrazki z popularnych witryn społecznościowych, takich jak Instagram, Facebook, Flickr, Imagely, Photobucket i innych.

Na przykład, jeśli chcesz dodać zdjęcie z Instagrama, po prostu dodaj blok Instagram do edytora postów i wprowadź adres URL posta, który chcesz udostępnić.

Instagram embed in WordPress

Następnie wystarczy kliknąć wybrane wyrównanie na pasku narzędzi. Bloki osadzania umożliwiają również łatwe osadzanie filmów w WordPress.

Więcej szczegółów można znaleźć w naszym przewodniku na temat tego, jak osadzać Instagram w WordPress.

Twoja wymarzona witryna – zbudowana przez prawdziwych ekspertów WordPress

Pożegnaj się z niekończącymi się szablonami i mylącymi kreatorami stron. Ułatwiamy uruchomienie idealnej strony internetowej dzięki dedykowanemu kierownikowi projektu, niestandardowemu projektowi WordPress i wielu poprawkom, aby udoskonalić wygląd.

Ty o tym marzysz, a my wprowadzimy to w życie – szybko, niezawodnie i zgodnie z Twoją wizją. Zaplanuj konsultację z naszym zespołem WordPress Website Design już dziś!

Dodatkowa wskazówka: Jak wyśrodkować wideo w WordPress

Jeśli dodasz wideo w WordPress, zostanie ono domyślnie wyrównane do lewej strony. Jeśli więc chcesz uzyskać inny wygląd, musisz go dostosować.

Wyśrodkowanie filmów może sprawić, że treści będą wyglądały bardziej przejrzyście, pozbywając się pustej przestrzeni po jednej stronie, nadając im bardziej profesjonalny charakter.

Aligning video to center

Pamiętaj tylko, że jeśli wideo jest mniejsze niż obszar treści, WordPress domyślnie umieści je po lewej stronie.

Aby dowiedzieć się więcej, możesz przeczytać nasz przewodnik na temat wyśrodkowywania wideo w WordPress.

Mamy nadzieję, że ten artykuł pomógł ci dowiedzieć się, jak łatwo dodawać i wyrównywać obrazki w edytorze bloków WordPress. Możesz również zapoznać się z naszym przewodnikiem na temat zmiany wysokości i szerokości bloku w WordPressie oraz z odpowiedziami na najczęściej zadawane pytania dotyczące Gutenberga.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

63 komentarzeLeave a Reply

  1. Gutenberg is still a big unknown for me. I’ll admit that I only started discovering it after WordPress 6.4 arrived and reading these pages. For a long time, for example, I could not figure out how to place an image and text next to each other (in Elementor it was a completely simple matter). After reading this article, I can do a little more with Gutenberg. Thanks for that.

  2. will this work with Iframes? I edit a custom HTML block and add iframe and the save and the add is lining up all the way to the left where all the other blocks are centered.?

  3. How do you align Featured Images that appear on the automatically generated Blog page and Category page? Clicking on the image opens the post, and there doesn’t seem to be an alignment setting for Featured image when filling in the post settings.

    • For the featured image, that would be determined by your theme. If you check with your specific theme’s support they should be able to assist with the alignment of your featured image.

      Admin

    • Unless your theme has a specific setting for it, most themes should have the text uniform if it is all the image caption and not a different text block.

      Admin

  4. I’m wanting to change the default for uploading an image to be centred every time. To change each image I upload to centre each time I add an image is so time consuming. Can I change the default to centre?

    • There is not a simple method we would recommend for beginners at the moment but we will keep an eye out for something we would recommend.

      Admin

  5. I am trying to use the Block Editor to display two images side by side. I used the two column feature then image blocks in each column. While designing, it displays correctly, but when I “preview in new tab”, the side by side columns are gone and the images are stacked. What am I doing wrong? Is this a common issue? How can I fix this?

    • You may want to ensure the images aren’t too large for them to be side by side in your specific theme for the most common reason for that issue.

      Admin

  6. I’m trying to learn how to use the new block editor. When I click on the Add block button and choose image to add a photo, I only get the ‘insert from URL’ option and I can’t find a way to add photos from my Media Library. Can you help?

    • You would want to check closely to find the text next to the upload button for selecting the image from your media library

      Admin

  7. I have been publishing a blog for many years. I have learned to dread the introduction of a new system. Doing a simple thing like adding photographs is now very difficult.

  8. Great information, problem is that back end it works but front end it always aligns to the left. Would it be possible that this has something to do with my Elementor template?

    • If you are using a page builder there is a chance that your page builder is overriding the styling and you can reach out to your builder’s support for assistance.

      Admin

  9. just started WordPress yesterday. Totally a beginner and so happy wpbeginner provided me the “trainer wheels” to jumpstart. The education in this website is so valuable. Can’t thank you enough.

  10. Thank you for this little gold nugget – really struggling getting in to the “new” way of handling my blog and almost giving up and searching for other alternatives…. :)

  11. You mention “Inline Image”, but I don’t see any such block. Your article was written awhile ago but supposedly updated in Jan. 2020 – did that block go away and you forgot to remove it from this article? Or a better question: How can I add an inline image within another block like Paragraph or Heading?

    • The inline image block is not currently available but you can normally recreate the formatting with the text and image or the standard image block

      Admin

  12. When I add an image from my media the image toolbar does not come up to align left or right. I can change size of image.

    • You would want to ensure you have not set it to be at the top of the page instead of how we have it at the moment.

      Admin

  13. Hello, I have aligned all images using the block editor and everything looks fine until I preview?

    Then some images have become far bigger than the others, I have a gallery of two images suddenly sitting on top of a single image. Everything has moved around randomly!

    Even when I published it, it was still all wrong. I would love your help, thank you!

    • You would want to reach out to your theme’s support to ensure there isn’t a styling conflict, otherwise, you could try disabling your plugins to see if this is a plugin conflict as well.

      Admin

  14. Hi, I’m looking to align shortcodes next to one another like you describe with the images is this possible? Many Thanks

  15. Hello,
    How do you arrange the positioning of the title for the cover blocks?

    You have that option in your bar, but for some reason, when I click on cover block, there is no text alignment option.

    Any ideas on this?

    Thank you for the great article.

    • You would want to check the top of your page as that would be the other location the alignment options would be rather than floating over the element

      Admin

  16. How do you make an image clickable with a clickable link? I’ve been looking for tutorials and they all seemed based on a prior Gutenberg block which since has changed an the tutorials no longer match the block.

    • You would want to check the top toolbar for the current location for where to add a link to an image

      Admin

  17. Hello, Is it possible to write an image caption right below the image when using the “Media & Text block”?

  18. There is an existing issue of incompatability between Gutenberg and themes. Do you have a list of themes that are compatable with Gutenberg (and that allow full functionality of Gutenberg)?
    Thanks and regards,
    Pete.

  19. I have been using wordpress for years but have been a bit absent lately. Gutenberg is a headspin. I follow these instructions but simply cannot align images in an image/text block. When I go to preview the image is aligned extreme hard left of the page with no margin at all. Any solutuions on offer?
    Thanks!!

    • If each image needs its own link then setting up columns would likely be what you’re looking to do :)

      Admin

    • If you want to add multiple images in the same area, you would want to take a look at the gallery block to add multiple images in one section

      Admin

    • You could disable the visual editor under Users>Your Profile but that would prevent you from using the visual editor for other sections.

      Admin

  20. I’m centering all of my images correctly in the editor, but they are all showing up as left-aligned in preview and live posts no matter what. Do you know what might be causing this? It’s driving me so crazy!

    • Your theme may be overriding the styling you are setting. If you reach out to your theme’s support they should be able to assist.

      Admin

  21. I would like to have an image next to a file (pdf) – all on the same line. Can I do that in one block, or would I need to create two? Thank you!

    • You would want to add the column block to split the content and allow you to display the content like that.

      Admin

  22. I am having creating captions for images and downloads that appear in my files. I don’t know where to go once I have the image in my files.

    • If you’re trying to add the image to a post or page you would normally add an image block and then select the file you want to use in the block

      Admin

  23. So now how do you do “no alignment”, where the image is on the left and has no text wrapping around it? This used to be easy with the no alignment option, which is now gone. Please bring this back! I am going crazy trying to figure out how to get my image on the left (not centered) and with no text next to it, but the text keeps wrapping around it automatically!

    • For what it sounds like you’re wanting, if you don’t specifically set the alignment for an image, the image should set itself that way.

      Admin

      • Just a quick followup on this, as it was annoying me as well. There’s a simple answer but it’s sort of not that obvious as I was looking for a setting – just press the selected alignment button again to turn off the alignment and revert to the default no alignment.

    • If you’re using the block editor, in the image block’s settings there should be a Link Settings section for you to set where an image links to.

      Admin

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.