How to display all custom fields associated with a post type – IN THE ADMIN AREA?

You need an action called manage_$post_type_posts_custom_column. This will allow you to add columns to your custom posts page. To be more precise, you need a filter to generate the column and an action to fill it with content. In your case something like this (untested): add_filter( ‘manage_chimpmunks_posts_columns’, ‘set_custom_size_column’ ); add_action( ‘manage_chimpmunks_posts_custom_column’ , ‘fill_custom_size_column’, 10, 2 … Read more

Order categories by sum of custom fields

$terms = get_terms( array( ‘taxonomy’ => ‘category’, ‘hide_empty’ => false, ) ); $sort = array(); //loop to list through all category foreach ( $terms as $term ) { $id = $term->ID; $name = $term->name; $args = array( ‘post_type’ => ‘post’, ‘category’ => $name, ); $query = new WP_Query( $args ); $sum = 0; if ($query->have_posts() … Read more