A
A
Anton2016-09-28 16:21:37
css
Anton, 2016-09-28 16:21:37

How to resize blocks in Wordpress?

The site has blocks with news announcements. When you add announcements of different lengths, the block sizes change accordingly. How to make blocks the same size?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav, 2016-09-28
@ak93

There are three solutions here, through HTML + CSS, through JS and through PHP.
In the first case, I would advise you to dig in the direction of trimming the content of blocks through overflow, overflow-text, and so on. There is another option through HTML, when you will not cut the blocks, but build such a grid from them, where one block will not overlap another, as you have now. This can be done through CSS flexbox.
In the second case, you can either write some code yourself that will change the text of blocks and / or their sizes, or use various libraries, for example, Masonry. The guide can be downloaded right here .
In the third case, everything is quite simple - you need to cut the text that changes depending on the block in length, displaying its first 300, for example, characters. To read the rest, you can offer the user a "Next..." link and redirect them to a separate ad page that you already have implemented.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question