Tag Info

Hot answers tagged


You can try the following approach using the the_title filter in the edit.php screen: /** * Modify post titles in the edit.php screen. * If the post title is empty, then show max 10 words from the post content instead. */ add_action( 'load-edit.php', function() { add_filter( 'the_title', function( $title ) { $post = get_post(); ...


You don't get any ordering, because you are making multiple get_posts() calls and only retrieve a single post in each of them. You cannot order a single post. :) You need to get rid of outermost loop and just pass a set of IDs (that would be your $instance['data']) to retrieve via single get_posts() call.


You can use posts_groupby filter: add_filter( 'posts_groupby', function( $groupby ) { return ''; } ); If you want to apply to remove the GROUP BY only to main query and in the frontend, you could do something like this: add_filter( 'posts_groupby', function( $groupby ) { if( ! is_admin() && is_main_query() ) { ...

Only top voted, non community-wiki answers of a minimum length are eligible