Pausing and Resuming WP_Query results

I think the best way to approach this might be to run your WP_Query just one time, but then access the stored query results three times to output each wanted set of data. This will save you from using multiple DB queries, and by using three separate loops, you can still add a parent div … Read more

How to add a column to edit posts area in admin panel?

What you see in the edit post columns is controlled by manage_posts_columns filter. By playlist_id i assume you are looking for the post_id (since you mentioned playlists are simply custom post types). You can do so by using this code in your theme’s functions.php file: if ( !function_exists(‘add_playlist_id_to_column’) && function_exists(‘add_theme_support’) ) { // Add our … Read more

List category posts alphabetically on archive.php

I suggest you use the pre_get_posts action hook provided by WordPress. Then, in your functions.php add the following code below: function custom_pre_get_posts($query) { // validate if(!is_admin() && $query->is_main_query()) { if(is_archive()) { $query->set(‘orderby’, ‘title’); // order posts by title $query->set(‘order’, ‘ASC’); // and in ascending order } } } add_action(‘pre_get_posts’, ‘custom_pre_get_posts’); You can learn more about … Read more