query_posts() problem with multiple tags since 3.1 update (6 posts)

  1. Acualux
    Posted 5 years ago #

    First of all, hi to everyone and thanks for reading or replying this post.

    I have a problem on a function where I have been using query_posts()
    with multiple tags as parameter, like this:
    Until now it worked quite well, but since the 3.1 update, it has been showing no posts. I want to know if there's a possibility that it could be a bug or an error.

    I thought it would have something to do about the use of taxonomy, but as I see at the Codex:

    query_posts( 'tag=bread+baking+recipe' );

    It's still fine to use it.

    The thing that makes me more confused is the fact that if I try
    "tag=tag1,tag2" instead of "tag=tag1+tag2", it WORKS! (but I want to force AND "+", not OR ",").

    Thanks again for your time.

  2. Josh Stauffer
    Posted 5 years ago #

    @Acualux, I just discovered the exact same issue that you are reporting. Please post any solutions you come across and I'll do the same.

  3. Josh Stauffer
    Posted 5 years ago #

    Alright, I have a solution. I am using WP 3.1.

    Old Query: does NOT work in 3.1

    query_posts( 'cat=8&tag=featured+hotels-and-motels&orderby=rand&posts_per_page=-1' );

    New Query: Works in 3.1!

    $args = array(
    	'cat' => 8,
    	'tag_slug__and' => array( 'featured', 'hotels-and-motels' ),
    	'orderyby' => 'rand',
    	'posts_per_page' => -1,
    query_posts( $args );

    Hope this helps and gets corrected soon.


  4. Acualux
    Posted 5 years ago #

    Thanks Josh!
    I think I will do something similar but using the renewed taxonomy meanwhile they correct this.

    If I come with another solution or know why this is happening I will post it ASAP.

  5. Josh Stauffer
    Posted 5 years ago #

    @Acualux, Right on. I did submit a ticket to Trac about the issue.

  6. cbourbeillon
    Posted 5 years ago #

    I have opened a new thread here, because the former replies here didn't really help me :

    I will be grateful to get any suggestion or help to solve my issue. Many thanks !

Topic Closed

This topic has been closed to new replies.

About this Topic