Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7673929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:37:29+00:00 2026-05-31T16:37:29+00:00

I have 3 loops each returning a taxonomy with different types , (client wants

  • 0

I have 3 loops each returning a taxonomy with different types , (client wants the ability to change text in a jQuery slideshow without coding). Can I integrate all 3 into 1 loop that queries the database for 3 separate types, returning posts in an unordered list like below, or am I stuck with using a loop for each type?

<ul class="sub-header-excerpts">
  <li> 
     <?php 
     $args = array( 'excerpts_textboxes' => 'Excerpt One', 'posts_per_page' => 1);  
     $loop = new WP_Query( $args );  
     while ( $loop->have_posts() ) : $loop->the_post();  
     ?>      
      <span class="textbox-title"><a href="#"><?php the_title(); ?></a></span>
      <span class="textbox-excerpt"><a href="#"><?php the_excerpt(); ?></a></span>
     <?php endwhile; ?> 
  </li> 
  <li> 
     <?php 
     $args = array( 'excerpts_textboxes' => 'Excerpt Two', 'posts_per_page' => 1);  
     $loop = new WP_Query( $args );  
     while ( $loop->have_posts() ) : $loop->the_post();  
     ?>      
      <span class="textbox-title"><a href="#"><?php the_title(); ?></a></span>
      <span class="textbox-excerpt"><a href="#"><?php the_excerpt(); ?></a></span>
     <?php endwhile; ?> 
  </li>  
  <li> 
    <?php 
     $args = array( 'excerpts_textboxes' => 'Excerpt Three', 'posts_per_page' => 1);  
     $loop = new WP_Query( $args );  
     while ( $loop->have_posts() ) : $loop->the_post();  
     ?>      
      <span class="textbox-title"><a href="#"><?php the_title(); ?></a></span>
      <span class="textbox-excerpt"><a href="#"><?php the_excerpt(); ?></a></span>
     <?php endwhile;   ?> 
  </li>  
</ul>

Edit:

$args = array(
    'tax_query' => array(
    'relation' => 'OR',
  array(
    'taxonomy' => 'excerpts_textboxes',
    'field' => 'slug',
    'terms' => array( 'Excerpt one', 'Excerpt Two', 'Excerpt Three' )
      ),
   )
);
$loop = new WP_Query( $args ); 
while ( $loop->have_posts() ) : $loop->the_post(); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:37:30+00:00Added an answer on May 31, 2026 at 4:37 pm

    http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
    It does mention selecting multiple taxamonies:

    $args = array(
        'tax_query' => array(
            'relation' => 'OR',
            array(
                'taxonomy' => 'category',
                'field' => 'slug',
                'terms' => array( 'quotes' )
            ),
            array(
                'taxonomy' => 'post_format',
                'field' => 'slug',
                'terms' => array( 'post-format-quote' )
            )
        )
    );
    $query = new WP_Query( $args );
    

    I never tried querying multiple taxamonies at once, but I do rember it’s a bitch

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have nested xsl:for loops: <xsl:for-each select=/Root/A> <xsl:for-each select=/Root/B> <!-- Code --> </xsl:for> </xsl:for>
i have a loop where a variable value will change in each loop and
I have an .each loop in jQuery. I want to iterate the loop one
In a SELECT call we are returning two different timestamps, but because each column
I have loop and each iteration of Hash looks like this: [1, {:clid=>1, :nvz=>4,
I have a loop that reads each line in a file using getline() :
I have a loop created with each, check this example: $('.foo').each(function(i){ //do stuff });
I have a for each loop like this $sn_count = 1; $prodfilter = ;
I have a loop that can look like this: For Each article In artAll
I have a listbox and I want to loop through each of the items

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.