show previous/next post orderer by title in custom post types

If you use a filter like the following to adjust the order of a post type archive, then the next & previous links will work perfectly without need for modification: function wpse_139866_set_order_by( $wp_query ) { if ( ! is_admin() && $wp_query->is_post_type_archive( ‘my_post_type’ ) && $wp_query->is_main_query() ) { $wp_query->set( ‘orderby’, ‘title’ ); } } add_action( ‘pre_get_posts’, … Read more

Two single.php files?

I’m a fan of page templates – Here’s what I would do. First create a page called something like Person Gallery, call it whatever you’d like. Then we can create either a separate template page-person-gallery.php or open our page.php and run a conditional in our loop to test if we’re viewing the Person Gallery Page: … Read more

Search page for custom post type

You can simply include a custom search function into your search by using pre_get_posts You can do something like this function search_filter($query) { if ( !is_admin() && $query->is_main_query() ) { if ($query->is_search) { $query->set(‘post_type’, ‘your-custom-post-type’ ); } } } add_action(‘pre_get_posts’,’search_filter’);

Selecting which pages to display custom post type on using checkbox

It sounds like you need to run a foreach on a value inside the array. E.g. $checkboxes[‘value’] as $checkbox.. If you do: print_r(‘$checkboxes’) you’ll get an idea of the values you are trying to target. You might even have to do something like $checkboxes[‘something’][‘something_else’] depending on how many levels the array has. Hope it helps, … Read more