WordPress Me Images Ko Ek Row Me Kaise Align Kare (3 Easy Methods Guide)
WordPress में photos को एक ही row (side-by-side) में align करने के 3 सबसे आसान तरीके — पूरा deep guide
agar aap chahte ho ki WordPress post/page mein photos ek hi line (side-by-side) mein dikhain — desktop se mobile tak perfectly — to yeh guide aapke liye hai. Main yahan 3 simple methods (Gutenberg Gallery, Columns block, Classic Editor HTML/CSS) step-by-step, best practices, accessibility, SEO, performance, plugin options, troubleshooting aur advanced CSS tweaks sab cover karunga. Ye guide beginner se advanced tak ke liye useful hai — aur Hinglish mein hai taki samajhna bhi aasan ho.
1) तरीका 1 — Gallery Block (Gutenberg) — सबसे आसान और recommended
क्यों use karein?
- Fast setup, responsive by default
- Columns easily set kar sakte ho (2,3,4…)
- Auto spacing aur alignment achha rehta hai
- SEO/Accessibility friendly (alt text) manage karna simple
Steps (step-by-step)
- WordPress admin → Posts → New Post or Edit existing.
- Editor mein
+(Add block) → Gallery search karo aur add karo. - Media Library khul jayega — multiple images select karo ya upload karo.
- Right sidebar (Block settings) mein Columns option milega — yahan
3choose karo (ya jitni photos ek row mein chahiye). - Agar aap chahte ho ki gallery mein har image ka link ho (media file ya attachment page), “Link to” choos karein.
- Caption add karna ho to har image par click karke caption likh sakte ho.
- Preview karo — agar mobile view mein chahiye to preview → responsive behavior check karo.
Tips
- Columns mein
3set kiya to default width adjust ho jayegi. Agar aap chahte ho ek row exactly 3 images consistently — use gallery columns = 3 aur ensure images ka aspect ratio milta julta ho to neat dikhai dega. - Image sizes: WordPress ke Image Size setting (thumbnail/medium/large) ke hisaab se images serve hoti hain. Gallery block automatic appropriate size choose karta hai.
- Lazy loading: Modern WP versions mein images lazy-load hoti hain by default (
loading="lazy"attribute). Ye performance improve karta hai. - Accessibility: Har image ka alt text bharo — jo SEO aur screen-reader users ke liye important hai.
2) तरीका 2 — Columns Block (Gutenberg) — perfect control per image
Kab use karein?
- Jab aap har image ko alag styling, alignment ya different sizes dena chahte ho.
- Agar aap image ke sath text ya button bhi same row mein rakhna chahte ho.
Steps
- Post →
+→ Columns block choose karo. - Columns count choose karo (2, 3, 4…). Agar aap 3 images ek row chahte ho → 3 columns choose karo.
- Har column ke andar
+→ Image block add karo aur apni image upload ya select karo. - Har Image block ke settings se width, crop, linking, alt text adjust karo.
- Agar spacing kam ya zyada chahiye to parent Columns block pe click → Block spacing / gap option use karo (agar theme/block supports karta ho).
- Preview & responsive check karo.
Example use-case
- Column 1: Image (60% height)
- Column 2: Image + caption
- Column 3: Image + CTA button (use Group block inside column)
Advantages
- Granular control: har image ko alag CSS class de kar style kar sakte ho.
- Responsive: Columns block automatically stack ho jata hai small screens par (lekin kabhi kabhi theme dependent).
- Professional layouts: text + image side-by-side banana aasan.
3) तरीका 3 — Classic Editor में HTML/CSS (Advanced users) — full manual control
Classic Editor use kar rahe ho ya advanced layout chahte ho? HTML + CSS se full control milega.
Basic flexbox HTML example
<div style="display:flex; gap:10px; flex-wrap:wrap; align-items:center;">
<img src="IMAGE-URL-1" alt="Alt text 1" style="width:33%; height:auto;" />
<img src="IMAGE-URL-2" alt="Alt text 2" style="width:33%; height:auto;" />
<img src="IMAGE-URL-3" alt="Alt text 3" style="width:33%; height:auto;" />
</div>
Cheezein dhyan mein rakhna
flex-wrap: wrap;add karne se small screens mein images wrap karenge — agar aap chahte ho strictly ek row on desktop aur stacked on mobile, ye best hai.width:33%use kar ke 3 images ek row mein perfect hogi. Agar gap chahiye togap:10pxrakho (modern browsers support karte hain).- Agar aap inline CSS nahi chahte, to theme ke custom CSS mein ek class define karein aur HTML mein us class ka use karo:
<style>
.my-flex-row { display:flex; gap:12px; flex-wrap:wrap; }
.my-flex-row img{ width:33%; height:auto; }
@media (max-width:768px){ .my-flex-row img{ width:100%; } }
</style>
<div class="my-flex-row">
<img src="..." alt="...">
<img src="..." alt="...">
<img src="..." alt="...">
</div>
Accessibility & SEO
- Hamesha
altattributes daalein. - Agar image important content show kar rahi ho to caption bhi add karein (use
<figcaption>with<figure>).
Example with figure/figcaption
<div class="my-flex-row">
<figure>
<img src="..." alt="...">
<figcaption>Caption 1</figcaption>
</figure>
<figure>
<img src="..." alt="...">
<figcaption>Caption 2</figcaption>
</figure>
<figure>
<img src="..." alt="...">
<figcaption>Caption 3</figcaption>
</figure>
</div>
Kabhi kabhi theme ke layout (sidebar, container width) ki wajah se images ek line mein sahi se nahi aati. Solution:
- Page template ko Full Width choose karo (Page Attributes ya theme page settings mein).
- Theme Customizer → Layout → No Sidebar select karo.
- Agar blocks ka max-width limited ho raha ho to
containerCSS adjust karo (agar aap child theme ya custom CSS use kar sakte ho):
.container { max-width:1200px; } /* ya apne theme ke according */
- Image size: Medium ya Large rakho — agar images bahut choti ho to
width:33%karne par blurry dikhega. - Agar theme kuch CSS override kar raha ho to inspect (browser devtools) karke conflicting rules find karo.
Responsive behavior — Mobile pe kya hota hai?
- Gutenberg Gallery & Columns: by default responsive hote hain — columns stack ho jate hain mobile pe.
- Flexbox method:
flex-wrap:wrap+ media queries use karo:
@media (max-width:768px){
.my-flex-row img{ width:100%; } /* single column on mobile */
}
- Agar aap chahte ho 2 images ek row mobile mein: set
width:50%inside media query.
Performance & SEO best practices (bahut important)
- Image optimization: Upload se pehle images compress karo (TinyPNG, Squoosh). Server side plugins jaise ShortPixel, Imagify, Smush use kar sakte ho.
- Modern formats: WebP images use karo agar possible ho (smaller filesize, faster).
- Responsive images: WordPress automatically
srcsetgenerate karta hai; use karo — ensure you upload high-res original so WP can create multiple sizes. - Alt text: Har image ka alt text meaningful rakho (SEO + accessibility).
- Lazy load: WordPress 5.5+ mein lazy loading default hota hai (
loading="lazy"). Agar aap plugin use kar rahe ho to check karo conflicts. - CDN: Agar traffic zyada hai to CDN use karo (Cloudflare, BunnyCDN) for faster image delivery.
- Avoid huge images: Retina screens ke liye 2x images chahiye ho to serve karo via
srcsetnot single huge files. - Image filenames: SEO-friendly filenames (e.g.,
organic-tomatoes-mumbai.jpg) — WordPress uses filename for initial alt/title but always update alt manually.
Accessibility (screen readers) — must do
altattribute: descriptive but concise.- Decorative images: use empty alt
alt=""so screen readers skip them. - Captions: use
<figcaption>or gallery captions for context. - Keyboard accessibility: agar images link hain (lightbox), ensure focus and keyboard controls available.
Plugins that help (agar aap UI plugin prefer karte ho)
- Envira Gallery — easy drag & drop, responsive galleries, lightbox, performance-focused.
- NextGEN Gallery — powerful, pro features for photographers.
- FooGallery — responsive galleries + templates.
- Jetpack (Carousel) — simple lightbox + gallery features.
- Smush / ShortPixel / Imagify — image optimization.
- Lazy Load by WP Rocket — if native lazy-load not enough.
- Regenerate Thumbnails — agar aap theme change ke baad image sizes regenerate karna chahte ho.
Note: plugin choose karte waqt check karo plugin ka reputation, update frequency, compatibility with your WP version and theme.
Advanced CSS tweaks & common customizations
1. Equal height images (object-fit)
Agar images different aspect ratios ke hain aur aap chahte ho same height:
.my-flex-row img{
width:33%;
height:250px;
object-fit:cover; /* crops to fill */
}
2. Add hover effects
.my-flex-row img{
transition: transform .3s ease;
}
.my-flex-row img:hover{
transform: scale(1.03);
}
3. Spacing control (gap)
Modern browsers support gap in flex:
.my-flex-row{
display:flex;
gap:16px;
}
Agar older browsers support chahiye to use margin on images: .my-flex-row img{ margin-right:16px; } and remove last-child margin.
4. Centering row in container
.my-flex-row{ justify-content:center; }
5. Make exact pixel widths
.my-flex-row img{ width:320px; } /* fixed width */
@media (max-width:1000px){ .my-flex-row img{ width:100%; } }
Troubleshooting — agar kuch kaam nahi kar raha
Problem 1: Images ek row mein nahi aa rahe (stack ho jaa rahi hain)
- Check parent container width — agar container narrow ho to images wrap karenge.
- If using CSS
width:33%+box-sizing:border-boxmissing — padding/border can push width over 100%. - Use
flex-wrap:nowrap;to force single line (but then images may overflow).
Problem 2: Images blurry after setting width:33%
- Upload original high-resolution images. WP creates different sizes; browser might be using a smaller size. Use
srcsetor upload a larger original.
Problem 3: Theme overrides blocks (spacing misaligned)
- Inspect element with devtools → find conflicting CSS selectors from theme and override via child theme CSS or Additional CSS (Customizer).
Problem 4: Mobile stacking not as expected
- Check media queries — maybe theme sets
columnslayout to force stacking at >768px. Add custom media query to override.
Problem 5: Lightbox not opening on gallery images
- Check “Link to” setting in Gallery block (set to Media File) or install a lightbox plugin. Some themes/plugins conflict with default behavior.
Examples: Real-world scenarios
Scenario A — 3 product images one row (desktop), stacked on mobile
Use Gallery block → Columns = 3. Ensure each image has alt, title, and small caption for product name. Add lightbox for zoom.
Scenario B — Blog post with featured image + 2 supporting images in same row
Use Columns block → 3 columns: col1 featured (image + overlay), col2 image, col3 image with CTA button under it. Use Group block inside columns for combining text/button under image.
Scenario C — Photographer portfolio (grid + masonry)
Use specialist plugin like NextGEN or Envira for gallery templates (masonry) and lightbox. For performance, enable lazy-load and WebP.
- Social platforms pick up Open Graph images & sizes. Ensure featured image and OG tags set (Yoast/RankMath plugin help).
- Gallery images rarely become social preview images — set one main featured image per post for sharing.
- For image search ranking: alt text, descriptive filename, caption, surrounding text (context) help.
Bonus: Small checklist before publishing
- Images optimized (compressed, appropriate size)
- Alt text meaningful for each image
- Captions added where useful
- Gallery/Columns responsive behavior checked (mobile/tablet)
- Lightbox set if you want zoom
- Page layout set to Full Width if needed
- Lazy load enabled
- CDN active if high traffic or large images
- Test in multiple browsers (Chrome, Firefox, Safari) and mobile
Quick-code cheat sheet (copy-paste)
Simple 3-in-row flex (responsive)
<style>
.row-3 {
display:flex;
gap:12px;
flex-wrap:wrap;
}
.row-3 img{ width:33%; height:auto; display:block; }
@media (max-width:768px){ .row-3 img{ width:100%; } }
</style>
<div class="row-3">
<img src="img1.jpg" alt="Alt 1">
<img src="img2.jpg" alt="Alt 2">
<img src="img3.jpg" alt="Alt 3">
</div>
Equal-height crop
.row-equal img{
width:33%;
height:280px;
object-fit:cover;
}
Final recommendation (aapke liye best option)
Agar aap beginner ho ya fast clean solution chahte ho — Gallery block (Gutenberg) with 3 columns use karo. Agar aapko per-image control, overlay, CTA chahiye to Columns block choose karo. Aur agar aapko pixel-perfect control ya custom styling chahiye to Classic Editor + flexbox CSS use karo (or use child theme custom CSS).