Order of custom query
-
I have this custom query for videos (post type in) my user favorites page:
if ( function_exists('wpfp_get_users_favorites') ) $fp_ids = wpfp_get_users_favorites(); $favorite_videos_query = new WP_Query(array( 'post_type' => 'videos', 'post__in' => $fp_ids, 'orderby' => 'post__in' )); if ( $favorite_videos_query->have_posts() ) : while ($favorite_videos_query->have_posts()) : $favorite_videos_query->the_post(); get_template_part(loops/videos','favorites'); endwhile; wp_reset_postdata(); endif;
My problem is the order of the favorites. When a user favorites a new video, the video shows in last on the list of his favorites. That’s not user friendly.
How can the custom query order the last added favorite video on the top of the list?
I’ve tried with order => ASC and order=> DESC but the query does not organizes it by the order the user favorited it.
Any help please?
- The topic ‘Order of custom query’ is closed to new replies.