D
D
Dmitry Polyakov2017-04-17 10:00:39
css
Dmitry Polyakov, 2017-04-17 10:00:39

How to check if there is content in a particular post?

I need to check a post for content in it, how can I do this in wp?
Option: add content to a div with display:none and check if there is content, not an option) the page with a list of posts takes a very long time to load

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2018-04-19
@Stalker_RED

This can also be done with border-radii https://jsfiddle.net/kuwLs2wa/
And with gradients in the background
And with shadows
And substitute a picture (svg?) into the background, as it was done there.
And also via clip-path.

M
Mr Crabbz, 2017-04-17
@James_Raynor

$checkThis = 66;   // сюда id проверяемой записи. Как получить id записи - зависит от места, где вам нужно это всё проверять.
$checkContent = get_the_content($checkThis);
if($checkContent && $checkContent !== ""){
 // Если контент есть - делаем магию
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question