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

using $wpdb to insert a form into a post

In the success part of your code, you can build an array representing a post, and use wp_insert_post as such : Example $mypost = array( ‘post_title’ => ‘My Title’, ‘post_type’ => ‘page’ //… add other fields according to your form ); $mypost_id = wp_insert_post( $mypost ); //Returns new post id on success Any field you … Read more

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