Can I reuse Wordpress Query twice on the same page without query?

Not sure if this is a weird or silly question, but I have a website with a homepage slider that set up something like the following: (obviously not real class names, but just descriptions of what they are)

.... WP QUERY, FEATURED POSTS ...
<ul>UPPER SLIDES CONTAINER</ul>
     <li class="Slide With Background Image">
        <div class="Slide Description">
            <span> Category </span>
            <h2> Title </h2>
        </div>
    </li>
    ....
</ul>

.... SAME WP QUERY, FEATURED POSTS ...
<ul class="Lower Slide Navigation">
    <li class="Slide With Background Image">
        <div class="Slide Description">
            <span> Category </span>
            <h2> Title </h2>
        </div>
    </li>
</ul>

It is set up this way because, since the main slide cycle is higher, the lower slides show previous and next upcoming slides.

Anyway, to my question: is there a way that I can just use a single DB query to populate both areas?

It seems ineffective to make the same call twice ...

+4
source share
1 answer
+5

All Articles