How do I display posts ordered by a date custom field?

I figured it out afterwards. Ended up using a different approach, I’m posting it in case someone has the same issue <?php date_default_timezone_set(‘America/Argentina/Buenos_Aires’); $posts_by_date_field = new WP_Query(array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1, ‘meta_key’ => ‘fecha’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ‘meta_type’ => ‘DATE’ )); if ($posts_by_date_field->have_posts()) : while ($posts_by_date_field->have_posts()) : $posts_by_date_field->the_post(); // LOOP … Read more

Get meta_query value by user meta array

This should be better for what you’re looking for, the only issue might be how the meta gets returned, as an actual array, or as a string that needs to be turned into an array. $args = array( ‘post_type’ => ‘pictures’, ‘orderby’ => ‘post_modified’, ‘order’ => ‘DESC’ // post_status is unnecessary because default is ‘publish’ … Read more

Multi Photo Upload with Caption on Front End for Custom Post Type

WordPress stores the images as attachment post type, so it is possible to add the title to each of your gallery images. For example, // $filename should be the path to a file in the upload directory. $filename=”/path/to/uploads/2013/03/filename.jpg”; // The ID of the post this attachment is for. $parent_post_id = 37; // Check the type … Read more