Created
February 17, 2017 15:21
-
-
Save thebigtine/499e58cb76c5c18127722f86ab893006 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $temp_query = $wp_query; | |
$args = array( | |
'post_type' => 'region' | |
); | |
query_posts($args); | |
if (have_posts()) { ?> | |
<form> | |
<select id="event-region-select" autocomplete="off" onchange='doSubmit();'> | |
<option disabled selected>Select a region</option> | |
<?php while (have_posts()) : the_post(); | |
$id = get_the_ID(); | |
?> | |
<option value="<?php the_field('region_slug'); ?>"><?php the_title(); ?></option> | |
<?php | |
endwhile; | |
wp_reset_query(); | |
?> | |
</select> | |
</form> | |
<?php } else { ?> | |
<form> | |
<select id="event-region-select" autocomplete="off" onchange='doSubmit();'> | |
<option disabled selected>Select a region</option> | |
<option value="northland">Northland</option> | |
<option value="north-shore-auckland">North Shore - Auckland</option> | |
<option value="auckland">Auckland</option> | |
<option value="waikato">Waikato</option> | |
<option value="bay-of-plenty">Bay of Plenty</option> | |
<option value="hawkes-bay">Hawkes Bay</option> | |
<option value="wellington">Wellington</option> | |
<option value="christchurch">Christchurch</option> | |
<option value="queenstown">Queenstown</option> | |
<option value="sydney">Sydney</option> | |
</select> | |
</form> | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment