• I’m trying to do this:

    $myVPname = get_the_title();

    $vpArgs = array(
    ‘post_type’ => ‘loan_closings’,
    ‘meta_key’ => ‘originator’,
    ‘meta_value’ => $myVPname //if I use ‘Fred Smith’ it works
    );

    $vpLoop = new WP_Query($vpArgs);

    Thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • the syntax looks ok;
    have you tried to print $myVPname to see if it contains what you assume?

    just bofore the line with your query;
    example:
    print_r($myVPname);

    Thread Starter jkd77

    (@jkd77)

    actually i had used echo $myVPname;, and that did output what I expected. I tried print_r() and it gives me the same. Does it matter that my value has spaces in it? I’ve even tried to convert the value to a string first…

    Thread Starter jkd77

    (@jkd77)

    Help?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘need to pass a variable to an array’ is closed to new replies.