From b0fa6a138468f77ae9be948be9f7d342d9da12e9 Mon Sep 17 00:00:00 2001 From: Ross Trottier Date: Thu, 22 Aug 2024 09:48:35 -0600 Subject: [PATCH] pagination and archive tweaks --- functions.php | 8 ++++++++ style.css | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/functions.php b/functions.php index cfee909..6859a80 100644 --- a/functions.php +++ b/functions.php @@ -52,6 +52,14 @@ function my_widgets_init() { } +add_action( 'pre_get_posts', 'set_archive_page_post_count' ); + +function set_archive_page_post_count( $query ) { + if ( $query->is_archive() && $query->is_main_query() && !is_admin() ) { + $query->set( 'posts_per_page', 13 ); + } +} + // Breadcrumbs function custom_breadcrumbs() { diff --git a/style.css b/style.css index 4f1118d..8ee5b7d 100644 --- a/style.css +++ b/style.css @@ -1317,6 +1317,15 @@ a.page-numbers, color: #fff; } +.page-numbers .current { + background-color: #FFDB12; + color: #414b4c; +} + +li:has(> .current) { /* styles to apply to the li tag */ + background-color: #FFDB12; +} + @media (min-width: 760px) { ul.page-numbers { justify-content: center;