Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter teatall

    (@teatall)

    I have already solved the problem. thanks a lot!

    Thread Starter teatall

    (@teatall)

    I tried your method a couple of times, but still failed. could you plz help me look at the following code and tell me where should i put the ‘$do_not_duplicate’ array?

    i now would like to have three latest sticky posts at the top of the list.

    $sticky=array(
                            'cat'=>2,/*category to be displayed*/
                            'showposts'=>3,/*number of posts to be displayed*/
                            'post__in'=>get_option('sticky_posts'));
    $others=array(
                            'cat'=>2,/*category to be displayed*/
                            'showposts'=>7,/*number of posts to be displayed*/);
    /*the query*/
    query_posts( $sticky );
    /*the 1st loop*/
    while ( have_posts() ) : the_post();
        echo '<li><a href="';
        the_permalink();
        echo '" title="';
        the_title();
        echo '">';
        get_short_title();
        echo '</a><span>';
        the_time('Y-m-d');
        echo '</span>';
    endwhile;
    /*reset query*/
    wp_reset_query();
    /*the 2nd query*/
    query_posts( $others );
    /*the loop*/
    while ( have_posts() ) : the_post();
        echo '<li><a href="';
        the_permalink();
        echo '" title="';
        the_title();
        echo '">';
        get_short_title();
        echo '</a><span>';
        the_time('Y-m-d');
        echo '</span>';
    endwhile;
    /*reset query*/
    wp_reset_query();

    thanks again!

    Thread Starter teatall

    (@teatall)

    thanks buddy!
    that’s quite illuminating.

Viewing 3 replies - 1 through 3 (of 3 total)