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

Sort categories by meta value

This is no solution, just an explanation: WordPress currently doesn’t have taxonomy meta data. You could add a stand alone table to add meta data there. Anyway, it’s not recommended to add your taxonomy/category/tag meta data to the options table as this one wasn’t made to get JOINed to do meta queries by it. My … Read more

Calling a custom profile field only it it exists

On an “author” page you can get a lot of the information you need with get_queried_object and additional information with get_user_meta. What you want (sounds like) should be in that second chunk of information.That is… $author = $wp_query->get_queried_object(); $ameta = get_user_meta($author->ID); var_dump($author,$ameta); // debugging if(!empty($ameta[‘facebook’])) { var_dump($ameta[‘yim’]); // debugging } // and so one for … Read more

Custom fields: my custom checkbox area doesn’t seem to work

I went through all this yesterday! According to the codex there must be a post id given to current_user_can to check ‘edit_post’, so your capability check should be: if( !current_user_can( ‘edit_post’, $post_id ) ) return; Also, your final two lines should be more like this: $chk = isset( $_REQUEST[‘page_title_off’] ) ? ‘on’ : ‘off’; update_post_meta( … Read more

Convert many posts from having a specific meta_key to use a post_format

After much reading, i realized that it would be more easily done using the WordPress API, so i baked out this little script. Simply add it to your theme’s functions.php then run it once. When done, remove it. function convertGalleries($test){ $galleries = get_posts(array( ‘meta_key’ => ‘custom_post_template’, ‘post_status’ => array( ‘any’ ),’posts_per_page’=>-1 )); if($test){ return count($galleries); … Read more

How to sort Custom Fields by a value

If you need sorted result by default,you need to query with sort parameters see https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters more more (example from the codes) $query = new WP_Query( array ( ‘post_type’ => ‘product’, ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘price’ ) ); Alternatively, you could also easily do the sorting using jquery plugins like tinysort ( see http://tinysort.sjeiti.com/ ) … Read more

Logic for Nearby places with post and categories

Could try a plugin called Geo mash up which turns WordPress into a GeoCMS, has nearby functionality built into it and can take long and lang values or addresses from custom fields. http://wordpress.org/extend/plugins/geo-mashup/ and try https://code.google.com/p/wordpress-geo-mashup/wiki/TagReference for the references.

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