Support » Theme: Sampression Lite » Add more sticky posts!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author Sampression


    Hi moneyvan,

    Currently sampression lite supports only one sticky post.

    Thank you,

    Sampression Team

    I too needed to show more than one stick post, and ended up child-theming sampression. For posterity, it is remarkably easy to show more than one sticky post, and there is truly no reason to “only support one stick post.”

    The code to edit (in your child theme) is index.php

    // Show only one Sticky Post
    $sticky = get_option( 'sticky_posts' );
    $args = array(
    	'posts_per_page' => 6,   // <------- HERE
    	'post__in'  => $sticky,
    	'ignore_sticky_posts' => 1

    Thank you mdjasper.
    It works, but sticky posts get overlapped by other posts. How this works out for others?

    I figured this out how to fix the overlap 😀 The problem is the jQuery that applies the positioning to the regular posts and not to the sticky posts. To fix this…

    Open loop.php and in the in the article section:

    <article id="post-<?php the_ID(); ?>" class="post columns four <?php echo sampression_cat_slug(); ?> <?php if ( is_sticky() && is_home() ) { echo 'sticky corner-stamp'; } else { echo 'item'; } ?> ">

    echo 'sticky corner-stamp';
    echo 'sticky item isotope-item';

    How the jQuery applies the same positioning to the stickies. And the number of posts you set in the index.php 'posts_per_page' => X now show at the top.

    Million thanks trishahdee, worked like a charm.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add more sticky posts!’ is closed to new replies.