Is it possible to completely replace a post with an action/filter?

You can try with using pre_get_posts add_action(‘pre_get_posts’,’alter_query’); function alter_query($query) { //gets the global query var object global $wp_query; //gets the front page id set in options $front_page_id = get_option(‘page_on_front’); if ( ‘page’ != get_option(‘show_on_front’) || $front_page_id != $wp_query->query_vars[‘page_id’] ) return; if ( !$query->is_main_query() ) return; $query-> set(‘post_type’ ,’page’); $query-> set(‘post__in’ ,array( $front_page_id , [YOUR SECOND … Read more

Get query result according to merged array

Use orderby post__in $loop = new WP_Query( array( ‘post_type’ => ‘product’, ‘post__in’ => $posts, ‘paged’ => $paged, ‘posts_per_page’ => 5, ‘orderby’ => ‘post__in’ ) ); Remember it is only available from version 3.5

Show Posts By Custom Field

Frankly, this question shouldn’t exist, it has been answered hundreds of times across the web.. Im going to answer the most tricky part – query itself. Everything else is simple HTML and PHP. You can also find examples in link I provided below. If you can’t do PHP and HTML yourself, you shouldn’t ask this … Read more

WordPress search for specific Post Type

Yes this is possible. There are numerous ways in which you can achieve this, either by creating a custom form and workflow or by overriding the default search template in WordPress and supply a request parameter for which can be used to identify the search request and filter the post types that should be searched. … Read more

How can I filter the post of a CPT by taxonomy Term in admin meta-box dropdown?

This question is WAY more complex than you realize. Despite that (or really, because of it) I’m going to give it a go… add_metabox(‘terms-post-selector’,’Select Related Post’,’post_terms_selector_dropdown’,null,’post’,’side’,’high’); function post_terms_selector_dropdown() { global $post; $taxonomy = ‘property_type’; // or whatever it is $terms = get_the_terms($postid,$taxonomy); $selectedterm = get_post_meta($post->ID,’_selected_term’,true); if (count($terms) > 0) { echo “<select name=”termselector” id=’termselector’ onchange=”loadpostterms();”>”; … Read more

List Authors For Current Category

Execution of code goes to infinite loop because you missed the_post() in loop. You can list all authors from current category:- Create an empty array for author IDs Check if current author ID exist in that array If No, display the author name and store that author ID in array. If Yes, Then skip that … Read more