Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions themes/jquery.com/page.php

This file was deleted.

14 changes: 14 additions & 0 deletions themes/jquery.com/sidebar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
if ( get_option( 'jquery_is_blog' ) ):
get_template_part( 'sidebar-blogpost' );
else:
?><div id="sidebar" class="widget-area" role="complementary">
<aside class="widget">
<h3 class="widget-title">Project</h3>
<ul>
<?php echo jq_page_links_for_category( 'meta', 'menu_order title' ); ?>
</ul>
</aside>
</div>
<?php
endif;
5 changes: 4 additions & 1 deletion themes/jquery/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1739,12 +1739,15 @@ input[type="submit"].dark:hover {
padding-left: 0;
}

#sidebar li.current {
font-weight: bold;
}

#sidebar nav#secondary li.current {
background-color: #eee;
margin-left: -35px;
margin-right: -20px;
padding-left: 35px;
font-weight: bold;
}

/* == Footer
Expand Down
14 changes: 8 additions & 6 deletions themes/jquery/functions.jquery.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,23 @@ function jq_post_category () {
return $current_category;
}

function jq_pages_for_category( $category ) {
function jq_pages_for_category( $category, $orderby = 'title' ) {
return get_posts( array(
'post_type' => '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 .= '<li><a href="' . get_permalink( $post->ID ) . '">' .
$post->post_title . '</a></li>';
foreach ( jq_pages_for_category( $category, $orderby ) as $page ) {
$attr = ( $page->ID === $post->ID ) ? ' class="current"' : '';
$ret .= '<li' . $attr . '><a href="' . get_permalink( $page->ID ) . '">' .
$page->post_title . '</a></li>';
}
return $ret;
}
Expand Down
Loading