Page 2 of 2 FirstFirst 12
Results 11 to 11 of 11

Thread: Sticky posts integrated with normal jobs

  1. #11
    Amateur
    Not a Verified Customer
    Pisos-Alquiler.com's Avatar
    Join Date
    Mar 2010
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sticky posts integrated with normal jobs

    Quote 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

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)