Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   Custom templates and sticky posts (http://forum.bytesforall.com/showthread.php?t=17711)

Mesjps Jun 1, 2012 02:27 AM

Custom templates and sticky posts
 
I'm trying to create som custom templates for a website, my problem are sticky posts.

I want to show posts from category "A" on page "A", posts from category "B" on pages "B" and so on, with the use of excerpts, thumbnails and kickers that Atahualpa provides.
I have tried to put some different code in my templates, this could be one of them:
<?php /* Get all sticky posts */
$sticky = get_option( 'sticky_posts' );
/* Sort the stickies with the newest ones at the top */
rsort( $sticky );
/* Get the 2 newest stickies (change 2 for a different number) */
$sticky = array_slice( $sticky, 0, 2 );
/* Query sticky posts */
query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1 ) );?>

But no matter which code snip I'm using and where in the template file I put it, the sticky post are not showing up at the top of the post-page.

Some help would be much appreciated.


All times are GMT -6. The time now is 12:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.