Order Custom post type loop by custom field (datepicker)

Your second approach should in my mind actually work, you do it like this: Code: $args = array( ‘post_type’ => ‘agenda’, ‘posts_per_page’ => -1, ‘meta_key’ => ‘datum_agenda’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’ ); $my_query = new WP_Query( $args ); There are two pages at the ACF documentation you might want to read: Date Picker … Read more

Create a select drop down of available menus

It is not intuitive but get_terms will do it, if I understand what you need. var_dump(get_terms( ‘nav_menu’)); If you look in the *_term_taxonomy table you can see why. The menus are stored as a taxonomy named nav_menu. This won’t get you things like page menus, only the intentionally created menus.

Using new WP_Query in shortcode in a custom field causes the main post content to not display

You’re using get_posts which returns an array of posts, which you can loop through using foreach, but not the_loop. Try this version of the code: function ia_news_display_test($atts){ // [ia_news cat=”category” num=’numbertodisplay’] extract(shortcode_atts(array( ‘cat’ => ‘any’, ‘num’ => ‘2’, ), $atts)); $dirloop = new WP_Query( array( ‘post_type’ => ‘ia_news’, ‘category_name’ => $cat, ‘posts_per_page’ => $num, ‘orderby’ … Read more

Getting Custom Field data from a page hierarchy

This one might get you started (this one is for the size as you can see since i do value 1 times value 2) (just to give an example of more advanced queries) global $edl_global_join; global $edl_global_orderby; global $wp_query; function edl_posts_join ($join) { global $edl_global_join; if ($edl_global_join) $join .= ” $edl_global_join”; return $join; } function … Read more

Metabox nonce PHP notice

// Save the Metabox Data function wpt_save_product_meta($post_id, $post) { if($post->post_type!=’post type with metabox’) { return $post->ID; } // verify this came from the our screen and with proper authorization, // because save_post can be triggered at other times if ( !wp_verify_nonce( $_POST[‘product_noncename’], plugin_basename(__FILE__) )) { return $post->ID; } // Is the user allowed to edit … Read more

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