WP_query ‘orderby=none’ Problem

You can order them manually after the query is complete: $ids = array (60, 23, 78, 46, 105, 130) $args = array ( ‘posts_per_page’ => -1, ‘post__in’ => $ids, ‘orderby’ => ‘none’ ); $query = new WP_Query ( $args ); $ordered_posts = array(); foreach($ids as $rpid) foreach($query->posts as $index => $fpid) if($fpid->ID === $rpid) $ordered_posts[] … Read more

Custom search form with empty parameters

That’s certainly something you must solve on the server side, only omitting the arguments in URL would cause errors when accessing the non-existent keys in the $_GET array. You should build your arguments array dynamically based on whether the values are set ot not. Example: $args = array(); foreach(array(‘s’, ‘country’, ‘year’) as $key) { // … Read more

Highlighting Sub topic in a post?

But am looking for a plugin or a code which can help me with adding this note every time I write a post. A shortcode to add that “note” is trivial. function note_sc_wpse_107275($atts,$content) { return ‘<p class=”note”><strong>’.$content.'</strong></p>’; } add_shortcode(‘note’,’note_sc_wpse_107275′); Then just add [note]Note content[/note] to your post body. That will give you exactly what you … Read more

pagination doesn’t show up for custom post type

Rather than attempt to fix your query, I recommend you sidestep it entirely by using custom post type archives! With permalinks on, you should be able to view a list of all your movies posts by going to: example.com/movies Then, in your theme, create archive-movies.php, and it will be used instead of the archive.php/index.php for … Read more