Welcome to WebmasterWorld Guest from 54.162.240.235

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

How to display sticky post on the bottom of the main page?

     
7:56 pm on Sep 11, 2012 (gmt 0)



Is there any way to display it on the bottom instead?

I am using Twenty Eleven 1.4, and the code is as follows:

<?php if ( is_sticky() ) : ?>
<hgroup>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<h3 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h3>
</hgroup>
<?php else : ?>
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<?php endif; ?>

I changed it to:

<?php if ( !is_sticky() ) : ?>

<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>


<?php else : ?>

<hgroup>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<h3 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h3>
</hgroup>

<?php endif; ?>

...but it doesnt make a difference. The sticky post still stays on the top. Is thery any way to move it to the bottom of the main page and make it stay there. What makes sticky posts stay on the top (what code and where is it located) of page one, instead of, lets say in the middle of page 3?

Thank you.
10:47 pm on Sep 11, 2012 (gmt 0)

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



I'm not sure how WP handles sticky posts but if you want a single post to display at the bottom of the top page then you can use this code:

   
<?php
$my_id = 34;
$post_id_34 = get_post($my_id);
echo $post_id_34->post_title;
echo $post_id_34->post_content;
?>


Simply calls a single Post by it's ID (34 in the example) and outputs the title and content. Add your HTML & CSS as you wish.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month