WP_Query no space in arguments?
-
Hi guys,
just a small thing that I figured out while working on a custom query. I started my code like this:
<?php $my_query = new WP_Query('post_type = london_hotel'); while ($my_query->have_posts()) : $my_query->the_post(); ?>
with a space between the equal sign and both post_type and london_hotel. It didn’t work. It worked only when I removed the space. There is no mention to this in the documentation. Now, is it something I’m missing here? PHP in general doesn’t care if you have a space or not between a term and an equal sign.
Thanks in advance for any help.
- The topic ‘WP_Query no space in arguments?’ is closed to new replies.