Created
October 24, 2012 20:11
-
-
Save fatihtoprak/3948537 to your computer and use it in GitHub Desktop.
wp#3 özel query dropdown ile
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 | |
# http://wordpress.stackexchange.com/questions/59486/mysql-custom-wp-query | |
?> | |
<?php | |
$values = get_tags(); | |
if(sizeof($values) > 0) : ?> | |
<select name="tags"> | |
<option value="">default</option> | |
<?php | |
# I've used value=id instead of name / slug, which is always better, but just change the index if desired | |
foreach ($values as $value) : ?> | |
<option value="<?php echo($value->term_id); ?>"><?php echo($value->name); ?></option> | |
<?php endforeach; ?> | |
</select> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment