twenty twelve front page how to have one sticky post only
-
I am using twenty twelve “featured posts” for my front page. The front page is here. It looks the way I want, except I only want sticky posts to show. (Currently I only have one sticky post. The second post is in a category “news” and is not sticky.)
I changed a child version of the style.css and modified a child version of content.php to get the featured post to look and say what I want. But from what I’ve read in the codex about how templates are applied, I think the front page is using index.php to display everything else. (I tried switching to a static front page, but can’t make it look the way I want.)
Can anyone tell me these things:
1. Since I think index.php is applied to more than just the front page – is that where I tell it not to display anything but sticky posts on the front page – or do I use a different template?
2. Can I do something to this code from the child content.php that will only affect the front page?<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if ( is_sticky() && is_home() && ! is_paged() ) : ?> <div class="featured-post"> <?php _e( 'Call now for your Siesta Key vacation reservations: 941-349-0545.', 'twentytwelve' ); ?> </div> <?php endif; ?> <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>
Thank you so much for any help anyone can offer. I’ve been on this for two days and the more I read, the more confused I am getting.
- The topic ‘twenty twelve front page how to have one sticky post only’ is closed to new replies.