WordPress archive page for multiple post types

If you want to make an archive page for multiple post types you want to show the title of the post type first. You can do that by using:

<?php post_type_archive_title(); ?>

http://codex.wordpress.org/Function_Reference/post_type_archive_title

For showing the content you can use the normal loop. But if you want to modify the loop by query_post(); you have to make a variable for ‘post_type’ that automatically fills in the right post type name.

You can do that by using the get_queried_object(); function:

http://codex.wordpress.org/Function_Reference/get_queried_object

As follows:

<?php
$obj = get_queried_object();
$post_type = $obj->name;
$args = array(
  'post_type' => $post_type,
  'orderby' => 'title',
  'order' => 'ASC',
  'posts_per_page' => 20,
 );
query_posts($args);
// And then the loop
?>