0

I use wordpress 3.9.3. It already has many posts tagged with respective YEAR and are displayed under their respective tags on the relevant page. I added new posts tagged with 2015, but they somehow refuse to appear on the post page. Is there any setting that need to be enabled for a tag? And here is the code that should be able to handle newer years, imo.

<?php $year = date('Y'); ?>
<?php while ($year > 2004): ?>
<?php $pub_args = array( 'tag' => $year, 'posts_per_page' => -1, 'nopaging' => true, 'orderby' => 'date', 'order' => 'desc' );
$pub_posts = new WP_Query($pub_args); 
0

The first line in the code is the culprit. It takes in current year and starts gathering posts from current year and goes into the past.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.