WP Query Returning All Posts

I think you’re confusing old meta parameters with new meta_query parameters. meta_key should be just key and meta_value should be just value. Refer to WP_Query in Codex for correct syntax. Also, print_r( $country_query ); will show you the actual SQL query being sent to the database and will show you where you’re going wrong.

Add Paypal Button programmatically

You can create a custom template in the theme that displays the ‘products’ custom post types (see the section on Template Files in Custom Post Types). Then code the HTML for the Paypal button in to your specific single-{posttype}.php and have the attributes such as price, etc, coming from custom fields. <form target=”paypal” action=”https://www.paypal.com/cgi-bin/webscr” method=”post”> … Read more

Loop to display random posts only if a custom field matches category

Something like this should be the query you want to run, it adds a condition to the page query that requires the value in “meta_field” to equal the current category’s title. global $wp_query; $args = array(‘meta_query’ => array( array( ‘key’ => ‘meta_field’, ‘value’ => single_cat_title(“”, false), ‘compare’ => ‘=’ ) ) ); query_posts(array_merge($wp_query->query, $args)); // … Read more

Buddypress Add unserialized Profile Fields in Members Loop [closed]

I believe xprofile_get_field_data is unserializing the data for you, but it is still in an array. xprofile_get_field_data can return an array or a comma-separated string. xprofile_get_field_data( $field, $user_id = 0, $multi_format=”array” ) @param string $multi_format How should array data be returned? ‘comma’ if you want a comma-separated string ‘array’ if you want an array