How to pull in both published and future posts in custom query
-
Hi,
I have a piece of code that is checking if there is a tag equal to the slug of the current post and whether that tag has at least two instances.
This is a way of me connecting content of certain posts to a live blog.
The code below works perfectly but does not work for posts scheduled.
Does anyone know how I can query both published and future posts in the code below?
I’ve been racking my brains but nothing seems to work. Any help would be hugely appreciated!
<?php if ($all_the_tags); $slug = basename(get_permalink()); $all_the_tags = get_the_tags(); foreach($all_the_tags as $this_tag) { if (($this_tag->slug == $slug ) && ($this_tag->count >= '2' )) { ?> <a href="#modal" class="second button">View the live updates</a> <? } } ?>
- The topic ‘How to pull in both published and future posts in custom query’ is closed to new replies.