Permalink
Browse files

Add sticky post support. Closes #30.

  • Loading branch information...
dstrojny committed Jul 6, 2012
1 parent c132437 commit 3d7492f2e29874db515d827a5c5492754524fb93
@@ -31,9 +31,9 @@ article.format-link {
------------------------------------------------------------ */
.menu-toggle,
input#searchsubmit,
-li.bypostauthor cite span {
+li.bypostauthor cite span,
+.featured-post {
@include rem('padding', 1px 10px);
- cursor: pointer;
@include rem('font-size', 11px);
line-height: ($evbase/11);
font-weight: normal;
@@ -42,6 +42,10 @@ li.bypostauthor cite span {
border: 1px solid #d2d2d2;
@include border-radius;
@include box-shadow($shadow: 0 1px 2px rgba(64, 64, 64, .10));
+}
+.menu-toggle,
+input#searchsubmit {
+ cursor: pointer;
&:hover {
color: lighten($font-color, 10);
@include vertical-gradient($startColor: #f9f9f9, $endColor: #ebebeb);
@@ -54,6 +58,12 @@ li.bypostauthor cite span {
border: none;
}
}
+li.bypostauthor cite span,
+.featured-post {
+ color: #fff;
+ @include vertical-gradient($startColor: lighten($link-color, 20), $endColor: $link-color);
+ border: 1px solid darken($link-color, 2);
+}
/*---------------------------------------------------------
Responsive images
------------------------------------------------------------ */
@@ -72,9 +72,6 @@
@include rem('padding', 2px 5px);
@include rem('font-size', 10px);
line-height: ($evbase/10);
- color: #fff;
- @include vertical-gradient($startColor: lighten($link-color, 20), $endColor: $link-color);
- border: 1px solid darken($link-color, 2);
}
}
a.comment-reply-link {
@@ -44,6 +44,29 @@ header.entry-header {
}
}
}
+article.sticky {
+ .featured-post {
+ @include rem('margin-bottom', $vbase);
+ @include rem('padding', 0 5px);
+ @include rem('font-size', 11px);
+ line-height: ($evbase/11);
+ text-align: center;
+ }
+ @media screen and (min-width: 600px) {
+ header.entry-header {
+ @include clear();
+ float: left;
+ max-width: percentage(460/625);
+ }
+ .featured-post {
+ float: right;
+ text-align: left;
+ }
+ .entry-content {
+ clear: both;
+ }
+ }
+}
.entry-content {
h1,
h2,
@@ -9,12 +9,19 @@
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <?php if (is_sticky() ) : ?>
+ <div class="featured-post">
+ <?php _e( 'Featured post', 'twentytwelve' ); ?>
+ </div>
+ <?php endif; // is_sticky() ?>
<header class="entry-header">
<?php the_post_thumbnail(); ?>
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php else : ?>
- <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
+ <h1 class="entry-title">
+ <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
+ </h1>
<?php endif; // is_single() ?>
<?php if ( comments_open() ) : ?>
<div class="comments-link">

0 comments on commit 3d7492f

Please sign in to comment.