Re: Sticky posts integrated with normal jobs
Originally Posted by
Damien
what about
use this code before the loop:
Code:
query_posts('caller_get_posts=1');
[quote:2iq6hs6c]
gain, this parameter can be used with any of the other arguments for query_posts(). And this code doesn’t simply exclude posts marked sticky … it actually ignores the sticky status altogether. So if a person marks a post as sticky, by using this query_posts() parameter, you can have your loop act normally, not pulling that post to the top unless it is the latest post published (depending on the other query_posts parameters).
http://www.nathanrice.net/blog/definiti ... dpress-27/" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;[/quote:2iq6hs6c]
I've tried in this way without success. Do you know how to do damien?
Code:
<?php
$i = 1;
if(!empty($_GET['sort']))
{
$orderby=trim($_GET['sort']);
$order=trim($_GET['order']);
$key=trim($_GET['key']);
// create the sort by injection
$posts = query_posts($query_string . '&orderby='.$orderby.'&meta_key='.$key.'&order='.$order.'&caller_get_posts=1');
}
if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php if ($i % 2 == 0) { $alt = " class=\"alt\""; } else { $alt = " class=\"no\""; } echo "<div" . $alt;
if (is_sticky()) { echo " id='sticky' "; } echo ">";
?>
Regards