From bdc22c7ad40d3525594fee32d564fd9c627b35c3 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Thu, 26 Jul 2018 21:36:17 -0500 Subject: [PATCH] home page sticky loop --- dev.sync.sh | 0 footer.php | 2 +- functions.php | 2 +- home-loop.php | 19 ++++++++++++++----- 4 files changed, 16 insertions(+), 7 deletions(-) mode change 100644 => 100755 dev.sync.sh diff --git a/dev.sync.sh b/dev.sync.sh old mode 100644 new mode 100755 diff --git a/footer.php b/footer.php index ade3b42..258d110 100644 --- a/footer.php +++ b/footer.php @@ -1,3 +1,3 @@ diff --git a/functions.php b/functions.php index 7a2ad6d..df588a8 100644 --- a/functions.php +++ b/functions.php @@ -11,7 +11,7 @@ if (function_exists('add_theme_support')) { // add_image_size('custom-size', 700, 200, true); // call using the_post_thumbnail('custom-size'); $customHeaderArgs = array( - 'default-image' => get_template_directory_uri() . '/images/default-header.png', + 'default-image' => get_template_directory_uri() . '/images/default-header.jpg', 'width' => 1800, 'height' => 260, 'flex-height' => true, diff --git a/home-loop.php b/home-loop.php index 88b17b8..7e50d7a 100644 --- a/home-loop.php +++ b/home-loop.php @@ -1,18 +1,27 @@
+ + $sticky = get_option( 'sticky_posts' ); + $args = array( + 'posts_per_page' => 10, + 'post__in' => $sticky, + 'ignore_sticky_posts' => 1 + ); + $query = new WP_Query( $args ); + + if ( isset($sticky[0]) && $query->have_posts() ) { + while ( $query->have_posts() ) { + $query->the_post(); ?>
', '' ); the_post_thumbnail(); // the_excerpt(); ?>