Skip to content

Commit

Permalink
Merge pull request #159 from INN/52-article-sticky-sidebar
Browse files Browse the repository at this point in the history
Allow article sidebar to be sticky
  • Loading branch information
Josh Darby authored Feb 11, 2020
2 parents ee16cd5 + 22d276c commit 3447f84
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 46 deletions.
2 changes: 1 addition & 1 deletion wp-content/themes/citylimits/css/child-style.css

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions wp-content/themes/citylimits/less/single-two-column.less
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,17 @@
}
}
}


@media (min-width: 770px) {
.content-container {
display: flex;
#sidebar {
.widget-area {
position: sticky;
top: @measure;
}
}
}
}
@media ( max-width: 699px ) {
h1.entry-title {
font-size: calc( 20px + 3vw );
Expand Down
2 changes: 1 addition & 1 deletion wp-content/themes/citylimits/partials/content-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<?php if ( $subtitle = get_post_meta( $post->ID, 'subtitle', true ) ) : ?>
<h2 class="subtitle"><?php echo $subtitle ?></h2>
<?php endif; ?>
<h5 class="byline"><?php largo_byline( true, false, get_the_ID ); ?></h5>
<h5 class="byline"><?php largo_byline( true, false, get_the_ID() ); ?></h5>

<?php if ( ! of_get_option( 'single_social_icons' ) == false ) {
largo_post_social_links();
Expand Down
89 changes: 47 additions & 42 deletions wp-content/themes/citylimits/single-two-column.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,67 +71,72 @@
<?php if ( is_single() ) { do_action('largo_after_post_header'); } ?>
<?php if ( is_page() ) { do_action('largo_after_page_header'); } ?>

<div id="content" class="span8" role="main">
<?php
while ( have_posts() ) : the_post();
<div class="content-container">

$shown_ids[] = get_the_ID();
<div id="content" class="span8" role="main">
<?php
while ( have_posts() ) : the_post();

$partial = ( is_page() ) ? 'page' : 'single-classic';
$shown_ids[] = get_the_ID();

$partial = ( is_page() ) ? 'page' : 'single-classic';

if ( $partial == 'single-classic' ) {
do_action( 'largo_after_post_header' );

// https://github.com/INN/umbrella-citylimits/pull/5
// https://github.com/INN/umbrella-citylimits/issues/124
// largo_hero( null,'' );
if ( $partial == 'single-classic' ) {
do_action( 'largo_after_post_header' );

do_action( 'largo_after_hero' );
// https://github.com/INN/umbrella-citylimits/pull/5
// https://github.com/INN/umbrella-citylimits/issues/124
// largo_hero( null,'' );

?>
<div class="entry-content clearfix" itemprop="articleBody">
<?php largo_entry_content( $post ); ?>
</div><!-- .entry-content -->
do_action( 'largo_after_hero' );

<?php do_action( 'largo_after_post_content' ); ?>
?>
<div class="entry-content clearfix" itemprop="articleBody">
<?php largo_entry_content( $post ); ?>
</div><!-- .entry-content -->

<footer class="post-meta bottom-meta">
</footer><!-- /.post-meta -->
<?php
<?php do_action( 'largo_after_post_content' ); ?>

do_action( 'largo_after_post_footer' );
<footer class="post-meta bottom-meta">
</footer><!-- /.post-meta -->
<?php

do_action( 'largo_before_post_bottom_widget_area' );
do_action( 'largo_after_post_footer' );

do_action( 'largo_post_bottom_widget_area' );
do_action( 'largo_before_post_bottom_widget_area' );

do_action( 'largo_after_post_bottom_widget_area' );
do_action( 'largo_post_bottom_widget_area' );

do_action( 'largo_before_comments' );
do_action( 'largo_after_post_bottom_widget_area' );

comments_template( '', true );
do_action( 'largo_before_comments' );

do_action( 'largo_after_comments' );
} else {
?>
<section class="entry-content">
<?php
do_action('largo_before_page_content');
the_content();
do_action('largo_after_page_content');
?>
</section><!-- .entry-content -->
<?php
}
comments_template( '', true );

endwhile;
?>
</div>
do_action( 'largo_after_comments' );
} else {
?>
<section class="entry-content">
<?php
do_action('largo_before_page_content');
the_content();
do_action('largo_after_page_content');
?>
</section><!-- .entry-content -->
<?php
}

endwhile;
?>
</div>

<?php do_action('largo_after_content'); ?>
<?php do_action('largo_after_content'); ?>

<?php get_sidebar(); ?>
<?php get_sidebar(); ?>

</div>

</article><!-- #post-<?php the_ID(); ?> -->

<?php get_footer();

0 comments on commit 3447f84

Please sign in to comment.