F
F
Fedos Ch2014-03-30 14:12:23
WordPress
Fedos Ch, 2014-03-30 14:12:23

How to display a media file after a certain condition in wordpress?

There is a website on WordPress, a theme, everything is beautiful. You need to make sure that access to download / view / read a media file opens after a certain condition is met (for example, 1000 post views or 1000 shares from facebook or vk). I ask for help and advice)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Kim, 2014-03-30
@cyberS7

Set a pageview counter. For example, the value of the counter is written to the variable $i. And then check.

<?php if ($i >=1000) : ?> //проверяем, что количество просмотров больше или равно 1000.
<div>Скрытый блок</div> //тот самый скрытый блок, который откроется только при выполнении условия
<?php endif; ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question