<?php while ( have_posts() ) : the_post(); ?>
<?php if (is_page(171)) { //create variables for the venue type
$venueType = 'event-venue';
} else {
$venueType = 'reception-venue';
} ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php
$post_type = 'venues';
$tax = 'venue-city';
$tax_terms = get_terms($tax,'hide_empty=0');
if (is_page(12) || is_page(171)) {
//list everything
if ($tax_terms) {
foreach ($tax_terms as $tax_term) {
$args=array(
'post_type' => $post_type,
'venue-type' => $venueType, //test to see if we can add another dimension
"$tax" => $tax_term->slug,
'post_status' => 'publish',
'posts_per_page' => -1,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo "<h2 class=\"category-title\" > $tax_term->name </h2><ul class=\"page-listing\">";
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php
endwhile;
}echo "</ul>";
wp_reset_query();
}
}
} else {
//list everything
if ($tax_terms) {
foreach ($tax_terms as $tax_term) {
$args=array(
'post_type' => $post_type,
//'venue-type' => 'event-venue', //test to see if we can add another dimension
"$tax" => $tax_term->slug,
'post_status' => 'publish',
'posts_per_page' => -1,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo "<h2 class=\"category-title\" > $tax_term->name </h2><ul class=\"page-listing\">";
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php
endwhile;
}echo "</ul>";
wp_reset_query();
}
}}
?>
<?php endwhile; // end of the loop. ?>