Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Franz Ordó?ez

    (@franzbleu)

    Finally! I figured it out:

    <?php

    $featured_args = array(
    ‘post__in’ => get_option( ‘sticky_posts’ ),
    );

    $featured_loop = new WP_Query( $featured_args );

    $counter = 1;

    while( $featured_loop->have_posts() && $counter < 5 ) :
    $featured_loop->the_post();

    ?>

    (The post loop…)

    <?php $counter++; endwhile; wp_reset_postdata(); ?>

    I’ve tried things really close, but my mistake was use initially a var $i, as I thought it’s a too common name, so I named it $counter and problem solved! Thanks all for the help ??

    Thread Starter Franz Ordó?ez

    (@franzbleu)

    Thanks for your answer tiaanswart, but doesn’t work, when I do that, then reload, thows me “HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.”

    Thread Starter Franz Ordó?ez

    (@franzbleu)

    Hello! I already did it, so another methods suggested in general way, it keeps taking the whole amount of sticky posts.

    That’s the reason because I wrote you the code, i’m trying to find out what’s going on here D:

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