Save Custom Post Value
Save Custom Post Value
Save Custom Post Value
Custom fields for post or terms which don’t update on post update
You’re using $query-> but there is no variable named $query, it’s just pulled out of thin air, it has to come from somewhere, so PHP is generating notices complaining about it. It would be like if I answered the question with “you need to apply gabobobobble” or some other made up word. So instead, look … Read more
Add Content Column to Custom Post Type backend
You should be able to set the orderby value to meta_value_datetime. More info at WordPress: https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters Try this: $args = array( ‘post_type’ => ‘event’, ‘post_status’ => ‘publish’, ‘meta_key’ => ‘_start_at’, ‘meta_type’ => ‘DATETIME’, ‘orderby’ => ‘meta_value_datetime’, ‘order’ => ‘ASC’, ); $query = new WP_Query( $args ); Maybe there’s an issue with the date value formatting. … Read more
WP query_posts group by meta field related
Search custom type post
There is a syntax error in the add_action(). You’ve used a period . instead of a comma , to separate the action and the callback. Otherwise the callback seems to work as expected when I tested it locally. The correct syntax would be, add_action( ‘pending_to_publish’, ‘my_function’, 10, 1 ); When doing development work with WordPress … Read more
The structure of the array you’ve provided suggests that you’re trying to access an incorrect level of the array. Try to replace: $t[0][“_give_amount”] = 25.00; $t[1][“_give_amount”] = 65.00; $t[2][“_give_amount”] = 100.00; $t[3][“_give_amount”] = 250.00; $t[4][“_give_amount”] = 650.00; with: $t[0][0][“_give_amount”] = 25.00; $t[0][1][“_give_amount”] = 65.00; $t[0][2][“_give_amount”] = 100.00; $t[0][3][“_give_amount”] = 250.00; $t[0][4][“_give_amount”] = 650.00;
Can I use the ‘category’ taxonomy for both posts and a custom post type?