• Hello, I’m running Mimbo Free 3.0 theme on my site.

    By default, the lead area displays sticky OR latest post. I would like to change the code to display the sticky but only have posts from certain category in the loop.

    The code for this part in the theme looks like this:

    $postCount = 0;
    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts( 'paged=$page&post_per_page=-1&cat=' . get_query_var('cat') );
    while (have_posts()) { the_post();
    if( $postcount == 0 ) { /* sticky post stuff goes here */ }
    else { /* rest of the loop goes here */ }
    $postcount ++;

    Naturally, I tried to change the query to:

    query_posts('paged=$page&post_per_page=-1&cat=4,' . get_query_var('cat'));

    but that doesn’t work – it ends up displaying latest, not sticky post in the lead area.

    Basically, what I’m facing is having EITHER sticky post from all categories OR latest post from selected category. How to change this query to display sticky from a selected category?

    Thanks in advance,

    Justine

  • The topic ‘[Mimbo 3.0] Sticky posts from category?’ is closed to new replies.