Last active
May 8, 2018 20:56
-
-
Save erikyo/782805de561246baed0615571230eaa0 to your computer and use it in GitHub Desktop.
Include Sticky Post in Page Posts Count
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
$count_stickies = count(get_option( 'sticky_posts' )); | |
$ppp = 6; | |
$offset = ( $count_stickies <= $ppp ) ? ( $ppp - ( $ppp - $count_stickies ) ) : $ppp; | |
$args = array( | |
'posts_per_page' => $ppp - $offset | |
); | |
$loop = new WP_Query( $args ); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment