Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question