Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Custom templates and sticky posts


  #1  
Old Jun 1, 2012, 02:27 AM
Mesjps
 
1 posts · Jun 2012
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.

Bookmarks

Tags
custom templates, sticky posts

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Post Templates Revisited waded1 Atahualpa 3 Wordpress theme 12 Apr 7, 2012 11:15 AM
Auto-install borked custom templates - but I should have known better... rickheck New Versions, & Updating 3 Dec 15, 2011 03:37 PM
[SOLVED] How to Remove the Icon Sticky.gif in Sticky Posts lexsisney Center area post/pages 1 Apr 16, 2010 01:27 PM
[SOLVED] Posts marked sticky don't show up with sticky formatting genevieve Atahualpa 3 Wordpress theme 12 Jun 30, 2009 08:06 AM


All times are GMT -6. The time now is 11:03 PM.


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