Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm working on a little database for series based on wordpress. I've implemented a custom post type called "anime", some taxonomies (Genre, a_types..) and a lof of customfields. (based on acf). Now I'm working on a search page for this database and got some
unexplainable errors.

I can't unterstand what break the following code. When I only add on meta_value query everything works great. When I add two or more meta_values queries the query() breaks.

$args ->

Array
(
[post_type] => anime
[post_status] => publish
[orderby] => title
[order] => ASC
[showposts] => 10
[posts_per_page] => 2
[paged] => 0
[meta_query] => Array
    (
        [relation] => OR
        [0] => Array
            (
                [key] => originalname
                [value] => des
                [compare] => LIKE
            )

==>        [1] => Array
            (
E               [key] => germanname
R               [value] => des
R               [compare] => LIKE
O            )
R       [2] => Array
            (
?               [key] => englishname
                [value] => des
                [compare] => LIKE
==>         )

    )

[tax_query] => Array
    (
        [relation] => AND
        [0] => Array
            (
                [taxonomy] => a_types
                [field] => slug
                [terms] => Array
                    (
                        [0] => music
                    )

                [operator] => IN
            )

        [1] => Array
            (
                [taxonomy] => Genre
                [field] => slug
                [terms] => Array
                    (
                        [0] => psychological
                        [1] => race
                        [2] => shoujo
                    )

                [operator] => IN
            )

    )

)

share|improve this question
    
What kind of errors are you getting? –  gdaniel May 14 '13 at 18:05
    
The site won't load. I'm using the query_posts($args) and it looks like something is broken~ –  Knoobie May 14 '13 at 18:09
    
Check for commas after your arrays. It looks like your issue is the code itself not the function If you have one array, with multiple arrays inside, you need to separate them with commas. –  gdaniel May 14 '13 at 18:16
1  
This looks like a print_r output. Can you include the actual PHP code that generates this arguments array? –  dalbaeb May 14 '13 at 18:17
    
Sorry, no comments and a lof of trash inside the files.. File with the form and query($args) pastebin.com/bBhr91R2 File with $args with functions to create the $args: pastebin.com/fGHWtq6H –  Knoobie May 14 '13 at 18:27
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.