Custom Field values not Showing in Edit Page of Custom Post Type

Whenever in doubt about the functioning of WordPress functions, consult the Codex: http://codex.wordpress.org/Function_Reference/register_post_type There, we can see that when registering a post type the supports argument has many options, one of them custom-fields. So, this would enable the CF box for the CPT: $args = array( ‘labels’ => $labels, ‘public’ => true, ‘publicly_queryable’ => true, … Read more

Serial Number Delivery System Using WordPress

Here is an idea how we can sort the post based on custom field value and also I’d given some functions to change/delete custom field values. <?php $args = array( ‘post_type’ => ‘card’, // custom post type name – card ‘meta_query’ => array( ‘relation’ => ‘AND’, // return post with meta-field key status = ununsed … Read more

Extracting Address from Custom Post via Javascript for Google Maps API

Well, this is kind of easy.. The google-map API needs a format like Your Street 123, 54321 Your City Assuming you have your data like this: <div id=”street”>Your Street 123</div> <div id=”zip”>54321</div> <div id=”city”>Your City</div> Assuming you are using jQuery: (function($){ $.fn.create_gmap_address = function() { var street = $(‘#street’).html(); var zip = $(‘#zip’).html(); var city … Read more

List custom posts

Try to use WP_Query instead of using the SQL. You can get the reference here. Simple example would be like: $args = array( ‘post_type’ => ‘my_custom_post_type’, ‘meta_key’ => ‘date’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘meta_query’ => array( array( ‘key’ => ‘event_date’, ‘value’ => date() ) ) ); $query = new WP_Query($args); and use a … Read more