From 1d8a76ad3948836e6765c33fbdc20bba5237760c Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 10 Jun 2026 03:46:11 +0100 Subject: [PATCH] jquery.com: Add "Project" widget to the sidebar Ref https://github.com/jquery/jquery.com/issues/266 --- themes/jquery.com/page.php | 4 ---- themes/jquery.com/sidebar.php | 14 ++++++++++++++ themes/jquery/css/base.css | 5 ++++- themes/jquery/functions.jquery.php | 14 ++++++++------ 4 files changed, 26 insertions(+), 11 deletions(-) delete mode 100644 themes/jquery.com/page.php create mode 100644 themes/jquery.com/sidebar.php diff --git a/themes/jquery.com/page.php b/themes/jquery.com/page.php deleted file mode 100644 index 023587ed..00000000 --- a/themes/jquery.com/page.php +++ /dev/null @@ -1,4 +0,0 @@ - + 'page', 'category_name' => $category, 'posts_per_page' => -1, - 'orderby' => 'title', + 'orderby' => $orderby, 'order' => 'ASC' ) ); } -function jq_page_links_for_category( $category ) { +function jq_page_links_for_category( $category, $orderby = 'title' ) { + global $post; $ret = ''; - foreach ( jq_pages_for_category( $category ) as $post ) { - $ret .= '
  • ' . - $post->post_title . '
  • '; + foreach ( jq_pages_for_category( $category, $orderby ) as $page ) { + $attr = ( $page->ID === $post->ID ) ? ' class="current"' : ''; + $ret .= '' . + $page->post_title . ''; } return $ret; }