No – you cannot add a WP_Query to the standard $query. The former overwrites the latter.
it is basically all array or all string;
the moment you need one array, you need to convert the whole wp-query args to array syntax.
your example:
<?php $recent = new WP_Query('post_type=listing&post_status=publish&posts_per_page='.get_option('wp_recentlistingsnumber_home')); ?>
re-written in array syntax:
<?php $recent = new WP_Query( array('post_type' => 'listing', 'post_status' => 'publish', 'posts_per_page' => get_option('wp_recentlistingsnumber_home')) ); ?>
Thread Starter
du3z
(@du3z)
ahh. i understand now =) that’s helpful!
But i’m still hopelessly clueless as to how to get my custom post type to show @@ been looking at the code for 2 days now.
can’t find a clue where is the code pointing WP to load post_type=listing to the template it is using. not in index.php, not in functions.php, not in header.php, not in single.php. I basically went through most if not all of the .php files and ctrl-f [listing] to find a clue. @@
/end rant.
thanks^^
Thread Starter
du3z
(@du3z)
@ alchymyth, i just used the rewritten array syntax and added array(‘post_type’ => ‘listing’, ‘post_type’ => ‘project’, … … …
and i for the first time in a day and half i saw some real progress, at least it is tapping on the latest listings blog-type update on my homepage, and actually showing something~ now to figure out why the single post page isn’t showing!
-elated- thanks much
Thread Starter
du3z
(@du3z)
a moment of eureka!
It was as simple as a creating a single-[customposttypename.php]. And there i was searching for a ghost file that never existed. I supposed i couldn’t understand what the codex meant, until now that is. yay.
now i have another problem..but this case here is closed. yay happy.