Created
December 11, 2015 13:10
-
-
Save uncatcrea/5f18ebc1dcb973217d24 to your computer and use it in GitHub Desktop.
Modify the default number of posts displayed in a list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'wpak_posts_list_posts_per_page', 'wpak_set_nb_posts', 10, 2 ); | |
function wpak_set_nb_posts( $nb_items, $component ) { | |
//Check component slug to apply only to some of the "post list" components: | |
//(don't do this check to apply to all "post list" components) | |
if ( $component->slug === 'my-component-slug' ) { | |
$nb_items = 100; //Post number you want | |
} | |
return $nb_items; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment