Use PHP modulo operator (%) to determine the classes and use CSS to float them all left and set clear:right to the odd class.
Kind of hard to picture how you’re pulling the images without the code though. Could you post a clip of the code you used to pull the images?
If not you can resort to JS to add the classes dynamically after the page loads shudder.
Related Posts:
- How to add CSS class to custom logo?
- How important is it to enqueue a theme’s stylesheet?
- Solutions for generating dynamic javascript / CSS
- Enqueue a stylesheet for login page and make it appear in head element
- Generating CSS Files Dynamically Using PHP Scripts?
- Enqueue Stylesheets After Theme’s “rtl.css”
- Are the WordPress Core CSS styles really all nessesary?
- Understanding wp_add_inline_style
- Any alternate TinyMCE4 themes / subthemes?
- Hide a div that is part of all pages on one specific page
- Why I can’t add a CSS style in this WordPress theme?
- Can’t get staging site to display same way as live site. Completely stumped
- How to make a theme with more than one CSS file?
- Editing the custom background CSS
- add generated stylesheet from parent theme after child-themes style.css
- why does twenty eleven theme mix up the css measurement units?
- Adding inline styles from a widget
- Can’t edit style.css in subdirectory of my theme?
- Adding dashicon fonts to the admin of pre 3.8 installs
- How to Handle CSS for Multiple Header header.php Files?
- Convert a static website to a WordPress theme and import all existing content
- Custom CSS In Uploads Folder
- There’s an image named g.gif somewhere in my WordPress site
- How to highlight the current page in the nav menu?
- Root Sage theme styles are not working!
- Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?
- Modify the Additional CSS section (adding a disclaimer)
- Sub folder CSS that’s read by Admin panel
- WordPress 5.8 update problem custom theme styles are overridden by core styles common.min.css
- CSS won’t style output of wp_nav_menu() correctly
- Is it necessary to prefix every css class in a theme framework?
- Custom CSS without css.php file
- Dequeue a style file which is making website load slow!
- Weekly background code not working
- Do I need normalize.css when developing my own WordPress-theme?
- How to float an image in Gutenberg
- Multiple Page Templates & CSS
- Using PIE CSS in WordPress. “localizing” styles
- How to override checkbox styles if these inputs have a unique id [closed]
- How to add material design css in wordpress and woocommerce
- Font Awesome 5 Free – far working but fas is not? [closed]
- How to get javascript slider to work! [closed]
- How to disable wordpress from overload my stylesheet styles with customizer styles
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- How to i style the elements from the TinyMCE
- Using page-id-{ID} from body_class() in local dev, versus live staging
- How do I remove inline style in featured image markup?
- different way to achive stylesheet_url
- Custom image size vs CSS sizing
- Why is my CSS not loading?
- How to rotate every letter in a title
- Ideal inline dynamic CSS injection
- JQuery undefined and Stylesheet loads in bottom along with js files
- How can I wrap all blog posts image with
- theme style is applied on the dhasboard rather than the website
- White screen when attaching css to function.php
- SVG in list-style-image breaks when adding fill
- WordPress theme resource won’t load over VPN
- How to style bootstrap container in wordpress theme?
- CSS added through customizer neglects the need of a child theme?
- How to override template files in parent theme?
- LESS not working in WordPress [closed]
- Place title (in correct place) above image with opaque background [closed]
- A post with a clear:both in its css destroy the theme design, and the sidebar is moved to the bottom
- multiple html/css files for wordpress theme?
- CSS preprocessor file messed up after compiled
- Why I obtain different visualization when I run the website on my local machine and on remote server?
- How to create a WP theme that use BootStrap? [closed]
- my single.php is mixup on some post for no reason
- How to use the _S framework
- Tiny MCE custom styles, and preview in the backend
- .current_page_ancestor broken in Twenty Eleven
- WordPress Animation Adjustments
- style variations hurt the editing performance
- Why nav_menu_css_class doesn’t work with apply_filters?
- Default customizer colors aren’t displayed outside of the preview
- Find the source file causing a Mixed Content warning
- Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
- How can I fix my theme header for my CSS stylesheet?
- WordPress doesn’t load css, image and js files after moving local installation folder
- How to generate a rtl.css file for themes?
- Load multiple css simultaneously using functions.php
- Necessary css classes to be included in theme stylesheet
- overlay post title over post’s featured image
- Change site title color on individual pages
- Mobile view logo background colour in wordpress
- Enqueue Stylesheets After Theme’s “rtl.css”
- WordPress 3.5 + Foundation 5 not working on IE9
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- adding navigation to genesis themes
- How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?
- Header is not showing full width
- How do I middle-align my header menu items in WordPress [closed]
- How to resize video lightbox popup in wordpress? [closed]
- How can I get rid of the distance when I’m using list-style-type: none? [closed]
- Detect custom font size
- HTML to WORDPRESS [closed]
- Align images to the left of the content
- Image and font support missing in editor when deploying theme remotely
- WordPress search field won’t get wider