Sortable admin column for one meta key with three possible meta values

I’ve looked over 2 or 3 similar looking threads regarding sortable columns and the meta queries involved with making them work. None seem to resolve my exact problem. I am using the pre_get_posts filter to hook the sortable logic for an admin column. I have a post meta checkbox that I’d like to sort, it’s … Read more

Sort by custom field value

I have a page where I only want to show posts from a specific category. At the same time, I want the posts to be sorted by a custom field value in my posts: query_posts(‘category_name=” . str_replace(” “, “”, $store_name) . “&meta_key=wpfp_favorites&orderby=meta_value_num’); The sorting is not working however. The posts are not sorted by the … Read more

How to display sorted posts in the ‘All Posts’ page

I’ve been following this tutorial to build a sorting page for my posts: http://soulsizzle.com/jquery/create-an-ajax-sorter-for-wordpress-custom-post-types/ The sorting works fine, but the new sorting is not reflected back in the ‘All Posts’ section under ‘Posts’, it only displays sorted under the ‘Sort Posts’ submenu created by this code in the tutorial. How would I extend this further … Read more

Using database meta_values to calculate new post order using pre_get_posts or a ‘request’ hook

UPDATE: I have worked out my implementation of the selected answer at the bottom of this post. I’m implementing a sorting algorithm based on Reddit’s hotness algorithm, in addition to a time-decay (like Hacker News hotness algorithm). The code I am currently satisfied with is a result of trial and errors in some Excel sheets … Read more

How to add new tab to admin list of posts and handle result list

The goal is to show posts with special values of custom field (post meta) in separate tab. I know how to add new tab, here is a code: add_action( ‘views_edit-post’, ‘remove_edit_post_views’ ); function remove_edit_post_views( $views ) { $views[‘pre’] = ‘<a class=”‘.$class.'” href=”‘.admin_url().’edit.php?yourlink”>Name of Sort</a>’; return $views; } but I have no idea how and where … Read more