0

I know it's possible to have multiple post loops on the same page, what I'm trying to achieve is having a single loop that will grab all pages and posts and then display them in chronological order.

So far I've only been able to loop for one or the other using WP_Query, two separate loops isn't an option as I need to be able to sort the output by date.

Does anyone have any experience doing something similar? Any advice on where to start would be greatly appreciated.

1

1 Answer 1

1

try:

$args = array(
'post_type' => array('carmarket', 'bikemarket') // or 'post', 'page' etc whatever you want

);
$query = new WP_Query( $args );

ref: http://codex.wordpress.org/Class_Reference/WP_Query

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.