How to create a multiple choice radio group for a single theme option

case “radio”: foreach ($value[‘options’] as $option) { ?> <label for=”<?php echo “{$value[‘id’]}_{$option}”; ?>”> <input type=”radio” name=”<?php echo $value[‘id’]; ?>” id=<?php echo “{$value[‘id’]}_{$option}”; ?> value=”<?php echo $option; ?>” <?php checked($option, get_settings($value[‘id’])); ?> /> <?php echo $option; ?> </label> <?php } break; But I don’t recommend coding theme/plugin settings this way. The array above doesn’t just represent …

Read more

Anonymous Postings

you can use plugins fro the front-end posting: Post From Site uCan Post WP User Frontend Or you can create the form yourself <!– New Post Form –> <div id=”postbox”> <form id=”new_post” name=”new_post” method=”post” action=””> <p><label for=”title”>Title</label><br /> <input type=”text” id=”title” value=”” tabindex=”1″ size=”20″ name=”title” /> </p> <p><label for=”description”>Description</label><br /> <textarea id=”description” tabindex=”3″ name=”description” cols=”50″ …

Read more

A form in a custom widget

I remember a support topic i read with regard to a problem when you use the name name for one of your post fields, try prefixing your input names. <input type=”text” name=”my-name” … And see if that helps.. Follow-up #1 I performed a simple test inside a widget.. if( isset( $_POST ) ) { print'<pre>’;print_r( …

Read more

Google Map Latitude and Longitude values in form

Take a look at this I did for a client: http://lpoc.co.uk/properties-for-sale/ A user can click the map and choose where to search. When a user clicks it updates a couple of hidden fields. Feel free to look at the source code to see how its done. If you want a more in depth description of …

Read more

How can I populate a select element with terms from a custom taxonomy and filter post results?

Are you familiar with jQuery? You’ll want to post the term to a admin-ajax, and use the response to populate the second select. Here is the codex documentation: http://codex.wordpress.org/AJAX_in_Plugins A loose example for your situation: $first_term = $(‘#states’); $name = $first_term.children(‘option:selected’).text(); var data = { action: ‘tag_slug’, slug: $slug }; var ajaxurl=”wp-admin/admin-ajax.php”; $.post(ajaxurl, data, function(response) …

Read more