Multiple Loops In Tabs Only Displaying First Loop

Question

I’ve browsed all the other questions that could be related to this and still can’t find the answer. My code is only displaying the results of the loop in the first tab, but won’t show it in the second tab. Can’t figure out why. See code below:

<div class="tab-panels">
        <div class="panel entry-content active" id="tab_all-lines">
            <!-- Full Menu -->
            <?php
            $loop = new WP_Query(
                array(
                    'post_type' => 'featured_item', 
                    'post_status' => 'publish',
                    'posts_per_page' => -1,
                    'orderby' => 'title',
                    'order' => 'ASC',
                )
            );?>
            <ul id="menu-manufacturers-all-lines" class="menu">
                <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
                <li class="menu-item menu-item-type-post_type menu-item-object-featured_item">
                    <a href="<? the_permalink(); ?>"><? the_title();?></a>
                </li>
                <?php endwhile;?>
            </ul>
            <?php wp_reset_query(); ?>
        </div>
        <div class="panel entry-content" id="tab_lines-we-stock">
            <!-- Filter Menu -->
            <?php
            $loop_stock = new WP_Query(
                array(
                    'post_type' => 'featured_item',
                    'post_status' => 'publish',
                    'posts_per_page' => -1, 
                    'category_name' => 'lines-we-stock',
                    'orderby' => 'title',
                    'order' => 'ASC'
                )
            );?>
            <ul id="menu-manufacturers-all-lines" class="menu">
                <?php while ( $loop_stock->have_posts() ) : $loop_stock->the_post(); ?>
                <li class="menu-item menu-item-type-post_type menu-item-object-featured_item">
                    <a href="<? the_permalink(); ?>"><? the_title();?></a>
                </li>
                <?php endwhile;?>
            </ul>
            <?php wp_reset_query(); ?>
        </div>
    </div>

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/multiple-loops-in-tabs-only-displaying-first-loop/">

Multiple Loops In Tabs Only Displaying First Loop</a>
0
, Jason 2 months 0 Answers 65 views 0

Leave an answer