Dropdown Menu for Query_Posts

Here’s a simple example of a PHP dropdown, hope this helps. <select name=”mydropdownlist”> <?php $options = array(‘option1’ => ‘option 1’ ‘option2’ => ‘option 2’ ‘option3’ => ‘option 3’); foreach($options as $value => $caption) { echo “<option value=\”$value\”>$caption</option>”; } ?> </select>

Using and saving custom dropdown boxes on user profiles

You appear to be checking for variables that aren’t set. You set $selected $selected = get_the_author_meta( ‘user_top’, $user->ID ); But then you check for something called $topselected <select name=”user_top” id=”user_top”> <option value=”gotguns” <?php echo ($topselected == “gotguns”)? ‘selected=”selected”‘ : ” ?>>I got guns</option> The same thing happns with $middleselected and $bottomselected I think your problem … Read more

Custom fields: dropdown values depending on other custom field value

This is possible by using AJAX. The following links are containing more information about AJAX and implementation in WordPress: http://codex.wordpress.org/AJAX Ajax (Asynchronous JavaScript And XML) is a technology that allows a web page to perform actions or update dynamically, without completely reloading http://codex.wordpress.org/AJAX_in_Plugins This article, aimed at plugin developers, describes how to add Ajax http://wpmu.org/how-to-use-ajax-with-php-on-your-wp-site-without-a-plugin/ … Read more

Widget Development – Displaying dropdown content

$instance[‘page_id’] should be the post ID of the selected post. So … function widget($args, $instance) { $post = get_post( $instance[‘page_id’] ); echo $post->post_content; // you should add the common filters here var_dump( $post ); // more data } … should be a good start. To save the last value in the configuration form use selected(): … Read more

Display posts order by custom post in a dropdown menu

Now I can order de post_types. Any help for the multiple save? // The Callback function show_custom_meta_box_related() { global $custom_meta_fields_related, $post; // Use nonce for verification echo ”; // Begin the field table and loop echo ‘<table class=”form-table”>’; foreach ($custom_meta_fields_related as $field_related) { // get value of this field if it exists for this post … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)