How to find what index page a post is on?

There’s no way to do it directly but there’s a way to determine the position of a particular row in a mysql query. You can find out how to do it here- https://stackoverflow.com/questions/3614666/mysql-get-row-position-in-order-by Once you have the position you can divide it with the value from get_option(‘posts_per_page’) to determine the correct page number.

Split WP_POST table based on post types

You could filter ‘query’ (you get the complete SQL here) and search for the post type in that. Then switch the database depending on what you found. But I don’t think this would work well: You might end up with the same post ID used multiple times (in each DB) and some strange side effects … Read more

Restrict post navigation to current sub menu

As @Ravs mentions the third parameter in next_post_link()/previous_post_link() should be a boolean value indicating whether to restrict the link to a post in the same category. By default this is false. If set to true, it will choose the next (or previous) post which is in the same category as the current post. This includes … Read more

WP_Query get posts from custom posts by category

You’re using category query for your custom taxonomy. So it won’t work, because there are no categories with such IDs. You should use tax_query instead. // post types query while ( have_posts() ) { the_post(); // getting the categories $categoryIDs = array(); // it’s much nicer than concatenated string $getcategory = get_the_terms($post->ID, ‘custompostnamehere-categories’); foreach($getcategory as … Read more

Private Posts/Pages & Search

This is the default WordPress behavior. http://codex.wordpress.org/Content_Visibility#Private_Content Private posts are automatically published but not visible to anyone but those with the appropriate permission levels (Editor or Administrator). WARNING: If your site has multiple editors or administrators, they will be able to see your protected and private posts in the Edit panel. If you want to … Read more