Sort query by author: 1 author, then others

You could do that with a custom posts_orderby: add_filter( ‘posts_orderby’, ‘wpa58715_posts_orderby’ ); function wpa58715_posts_orderby( $orderby_statement ) { if ( is_post_type_archive( ‘article’ ) ) { global $wpdb; $orderby_statement = “FIELD($wpdb->posts.post_author, 42) DESC, $wpdb->posts.post_author”; return $orderby_statement; } } Swap in your author ID for 42.

Advanced Taxonomy Queries WordPress

This is not a complete answer, but I hope this can help. It sounds like what you’re looking for is a “Faceted” navigation (or search or browsing) plugin. There are some plugins that do this already, like this one (from the FCC!). It’s possible that none of the existing plugins will match your needs, but … Read more

Using WP_Query within an mu-plugin

I figured it out. I moved the reference to WP Alchemy within a function that fires after init. Everything now works great and I can use WP_Query within the setup files. Here’s a code reference: // WP Alchemy Setup function jd_setup_wp_alchemy() { include_once WPMU_PLUGIN_DIR . ‘/jonathanwold/metaboxes/setup.php’; include_once WPMU_PLUGIN_DIR . ‘/jonathanwold/metaboxes/cpt-spec.php’; } add_action(‘init’, ‘jd_setup_wp_alchemy’);

Modify WP Query post__in before have_posts()

I can see several possibilities for this one. First, I am not convinced that that you can’t use pre_get_posts though maybe you’d have to reorganize your code. You don’t have to wait for your theme template to use $_GET. Try: function tst() { // global $_GET; // sometimes necessary var_dump($_GET); } add_action(‘pre_get_posts’,’tst’); So I think … Read more

wp_query should show stickies first

Well for starters, the query arg showposts has been replaced by posts_per_page since WP v2.1 I don’t think any of your query args are being ignored (well, maybe save showposts; I haven’t checked to see if backwards compatibility support still exists for the arg). That said, I do not know what value your $top_row_posts variable … Read more

Exclude an array

Strange but it works with same principle I was trying to. Maybe I had some grammer error. Here is a code if somebody will need it in future as there was nothing in search result: // get product media library $mediaArgs = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘numberposts’ => -1, ‘post_status’ => null, … Read more