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.
Array
(
    [post_parent] => 101
    [post_type] => page
    [posts_per_page] => -1
    [orderby] => title
    [order] => asc
    [meta_query] => Array
        (
            [0] => Array
                (
                    [key] => rank
                    [value] => Assistant Professor
                )

            [1] => Array
                (
                    [key] => profession
                    [value] => Radiation Oncology
                )

        )

)

This looks right to me. But it's not working! ... Answer?? WP3.1 RC3

share|improve this question
5  
Could you post a dump of the final SQL generated by WP_Query? Easiest way would be by installing the Debug Bar plugin. Or just var_dump($wp_query->request) –  scribu Feb 4 '11 at 17:58
1  
Those query params look okay. Are you absolutely certain that you have a page that matches those criteria exactly? –  Dougal Campbell Feb 24 '11 at 21:28
    
how's this going? Found an answer yet? –  John P Bloch Apr 29 '11 at 1:24

1 Answer 1

I'm not familiar with the exact way you're doing it. I'm more familiar with the format that Scribu outlines on his blog.

I'd say you should at least be using quote marks on 'rank' and 'Assistant Professor', but there could be more to it.

If that's not working out, you could go old school and use a pre 3.1 solution, such as the one I outlined on the WordPress.org Support forum. That's using an SQL statement with aliases to find posts based on 4 Custom Fields.

It was posted a couple of years ago, so you might want to revise that for security - it should probably be using the prepare command for a start - but the basic concept should still work.

share|improve this answer
    
I'm pretty sure he copied a var_dump() of the query vars, since commas and all quote marks are missing. Also, the method you used in that answer is what WordPress does now. I think the questions above need to be answered before any sort of attempt is made at answering the question. –  John P Bloch Apr 29 '11 at 1:23

Your Answer

 
discard

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