Add categories to your custom posts. Ex:
add_action( 'init', 'create_gallery_taxonomies', 0 );
function create_gallery_taxonomies() {
$labels = array(
'name' => _x( 'B&A Categories', 'taxonomy general name' ),
'singular_name' => _x( 'B&A', 'taxonomy singular name' ),
'search_items' => __( 'Search B&A Categories' ),
'all_items' => __( 'All B&A Categories' ),
'parent_item' => __( 'Parent B&A Category' ),
'parent_item_colon' => __( 'Parent B&A Category:' ),
'edit_item' => __( 'Edit B&A Category' ),
'update_item' => __( 'Update B&A Category' ),
'add_new_item' => __( 'Add New B&A Category' ),
'new_item_name' => __( 'New B&A Category Name' ),
'menu_name' => __( 'B&A Categories' ),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'gallery-categories' ),
);
register_taxonomy( 'gallery-categories', array( 'gallery_post' ), $args );
}
Check out that last line where it sais “gallery_post”, that would’be your custom post type.
Then you can add the parameter to the url, and display only the ones from your category
$gallery_slug = $_GET['parameter'];
$gallery_menu = get_terms('gallery-categories', 'hide_empty=1');
foreach($gallery_menu as $item) {
if( $item->slug == $gallery_slug ) {
$current_cat = $item;
}
}
if( !$current_cat )
$current_cat = get_term(81, 'gallery-categories'); // DEFAULT CATEGORY TO SHOW
$args = array(
'post_type' => 'gallery_post',
'taxonomy' => $current_cat->taxonomy,
'term' => $current_cat->slug,
'posts_per_page' => -1,
'nopaging' => true,
);
$query = new WP_Query( $args );
On the single template, you have to check which category the post has to show whatever info is needed.