A
A
Anton Minaev2015-10-10 09:26:42
WordPress
Anton Minaev, 2015-10-10 09:26:42

How to assign a class to posts through one or display a thumbnail from left to right through one post?

Actually, I can not understand how quickly and easily to implement such functionality automatically. The first thing that came to mind was to catch the id through js and, if it is possible to divide by 2, set the class, inside which there will be a float with the desired value.
I think there are easier solutions :) I just can't formulate the search query correctly...
Many thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Perin, 2015-10-10
@AntonMinaev

nth-child css
Or in the article output loop, the counter i, and if i is even before we add one class, if not even, then another class

W
WP Panda, 2015-10-10
@wppanda5

Different thumbnail sizes on homepage?
just divide by 2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question