Overriding an existing filter

This is the pattern for a filter. Applying/using a filter on something: $filtered_version = apply_filters( ‘the name of the filter’, $the_thing_being_filtered ); This is how you use a filter to modify something: add_filter( ‘the name of the filter’, ‘name_of_a_function_that_will_modify_the_thing_being_filtered’ ); function name_of_a_function_that_will_modify_the_thing_being_filtered( $the_thing_being_filtered ) { // modify $the_thing_being_filtered here return $the_thing_being_filtered; } So in your … Read more

posts_per_page showing 16 elements instead of 3

Your query might be picking up sticky posts. To ignore them, try this: $args = array( ‘meta_query’ => array( array( ‘key’ => ‘featured_posts’, ‘compare’ => ‘==’, ‘value’ => ‘0’ ) ), ‘post_type’ => ‘post’, // Changed ‘3’ to 3, since WP_Query expects an int. ‘posts_per_page’ => 3, // Ignore the sticky posts. ‘ignore_sticky_posts’ => true, … Read more