Custom Post Type shows pagination (w/404) or posts_per_page query, but not both

user5477769 reports in the comments of the original post, that the problem has been solved: I was following Custom Post Type UI instructions but it seems it led me astray. Creating a archive-gallery.php with a vanilla Loop, along with removing is_main_query has solved all problems, and the pages now show with 9 posts and correct … Read more

Problem with type plugin and custom taxonomies

You need to pass the category name as well if you want to show posts from specific category.. You just need to add one more param to the get_posts array. REPLACE THIS <? $products = get_posts( array(‘post_type’ => ‘products’, ‘posts_per_page’ => 400,) ); ?> WIth THIS <? $products = get_posts( array(‘post_type’ => ‘products’, ‘category_name’ => … Read more

Orderby modified only for specific post types

Am Afraid that you have to go with Direct MYSQL or you can run two WP_Query() and then combine them, sort them or sort them with WP_Query() then combine them. Here is an example $args = array( ‘post_type’ => array( ‘staff-updates’, ‘coreteam’, ‘developing-updates’, ‘vacancies’, ‘recognition’, ‘page’ ), ‘orderby’ => ‘modified’, ‘posts_per_page’ => ’10’, ‘order’ => … Read more

Create 2-layered dropdown menus for custom taxonomy and custom post type

With a combination of jQuery / JavaScript and WP AJAX; you could look for an onchange event on the select box, send an ajax request to your admin-ajax.php with the year and then do a custom WP Query to return the html for the secondary drop down and append it to your dom. https://codex.wordpress.org/Plugin_API/Action_Reference/wp_ajax_%28action%29 http://api.jquery.com/jquery.ajax … Read more