Pagination for custom loop on custom page template is not displaying anything

Harman, don’t use get_posts() when pagination is required. You may also accomplish this task using WP_Query. Refer to this answer explained beautifully by Chip Bennett at How to fix pagination for custom loops? <?php $user_fav = get_user_favorites($user_id); $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : 1; $args = array( ‘posts_per_page’ => … Read more

How to query Posts from a custom post type which contains a custom taxonomy?

You have one or two issues here and possible future bugs that you might encounter term in your tax_query should be terms Be carefull with terms having dates as names and especially dates as slugs. This can cause issues and unexpected results if custom permalinks clash or if something falls into the template hierarchy for … Read more

BuddyPress activity on edit post for a CPT

Use the save_post hook. Try something like: function jude_classified_activity_entry( $post_id, $post, $update ) { $slug = ‘classified’; if ( $slug != $post->post_type ) return; bp_activity_add( // etc ); } add_action( ‘save_post’, ‘jude_classified_activity_entry’, 15, 3 );

is_404() – where does this get set?

There is a dedicated method for it WP_Query->set_404(). From quick search through code it can be set in WP_Query->parse_query() or WP->handle_404() (note WP, not WP_Query!). But it can (and sometimes does) get set on query externally, for example by plugin that needs to invalidate specific resource.