Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

MUltiple loops inside author.php WordPress

I need the following to be placed inside author.php in the following order...

Display all the author's posts from the custom post type (AAAAAAA), then
Display all the author's posts from the custom post type (BBBBBBB), then
Display the author's user meta from their profile, then
List all the author's normal posts from the author, then
List all the author's posts from the custom post type (CCCCCCC)

In effect this is 5 loops inside the author.php page. Ideally I can delete/ cut-out any loop without it affecting the other loops.

Points to note...
I want all the code to have closed php tags e.g
<?php blah blah ?>
<p>something here</p>
<?php ?>

Not this...
<?php blah; { ?>
echo "<p>something here</p>";
<?php } ;?>

Some handy links...
[[LINK href=""]][[/LINK]]
[[LINK href=""]][[/LINK]]

Answers (3)


Andrea P answers:

definitely agree with Sebastien.

you're asking for a big chunk of code here, not just for suggestions.
could you raise the budget please?

and also, do you already have a sample html/php of how you want to display the posts inside these loops? or do you just need the query and loop and a sample displaying like
<p><?php the_title() ?></p>
within the loop


Rempty answers:

I think the better solution is create 5 indepentent loops. You can get the author id with this code (inside author.php)

$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));

With this id you can create a custom query for each post type.

$cquery=new WP_Query($args);
<p><?php the_title();?></p>