Skip to content

learn.jquery.com: change highlighting links #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 7 additions & 4 deletions themes/learn.jquery.com/sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ul>
<?php $chapters = learn_chapter_listing(); ?>
<?php while ( $chapters->have_posts() ) : $chapters->the_post(); ?>
<?php $is_active = ($active_post->ID == $chapters->post->ID) || ($active_post->post_parent == $chapters->post->ID); ?>
<?php $is_active = ($active_post->ID == $chapters->post->ID); ?>
<li <?php if ($is_active) { echo "class='active'"; } ?>>
<a href="<?php the_permalink(); ?>">
<?php if ( get_post_meta( $post->ID, "icon" ) ) : ?>
Expand All @@ -32,9 +32,12 @@
<ul class="sub-chapter">
<?php while ( $sub_chapters->have_posts() ) : $sub_chapters->the_post(); ?>
<?php if ( has_children( $post ) ) { ?>
<li><a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a></li>
<?php $is_active = ($active_post->ID == $sub_chapters->post->ID) || ($active_post->post_parent == $sub_chapters->post->ID); ?>
<li <?php if ($is_active) { echo "class='active'"; } ?>>
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</li>
<?php } ?>
<?php endwhile; wp_reset_postdata(); ?>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions themes/learn.jquery.com/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ a {

}

#sidebar #chapter-listing li.active a {
#sidebar #chapter-listing li.active > a {
background: #212121;
color: #fff;
text-shadow: none;
}

#sidebar #chapter-listing li.active a i.icon-tasks {
#sidebar #chapter-listing li.active > a i {
color: #fff;
}

Expand Down