Query WP Page for Buddypress Group Home [closed]
Your problem is bp_the_group(). This function doesn’t return a value – it’s akin to WP_Query’s the_post(). Try: ‘pagename => bp_get_current_group_slug()
Your problem is bp_the_group(). This function doesn’t return a value – it’s akin to WP_Query’s the_post(). Try: ‘pagename => bp_get_current_group_slug()
It sounds like you have a filter running on that page that’s adding an offset parameter to your WP_Query. There aren’t any really easy ways to search for all filters. The plugin Hikari Hooks is the simplest that I’ve seen. If you install and activate that plugin and view the problem page, you should be … Read more
First thing to do is check for any plugins that affect search results. The reason is that I had the ‘Search Everything’ plugin running. While it was meant to search for more results and highlight the search terms, it will change any instance of new WP_Query(); making it useless. This is the callback function to … Read more
Did you try $query = ‘posts_per_page=3&cat=3’; ?
have you tried get_page() ? $page_id = 123; // 123 should be replaced with a specific Page’s id from your site, $page = get_page( $page_id ); // You must pass in a variable to the get_page function. echo ‘<h3>’. $page->post_title .'</h3>’;// echo the page title echo apply_filters(‘the_content’, $page->post_content); // Get Content and retain WordPress filters … Read more
You can filter your query_posts() results by a custom meta field with the “meta_query” array and its corresponding subfilters. For more information check the WordPress codex on Custom Field Parameters. http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters An alternative method would be to setup the new filter variables in WordPress’ query_vars and use that instead of $_GET: http://codex.wordpress.org/Custom_Queries#Custom_Archives
If you’re using multiple queries on same page, you should always use wp_reset_query, place it after loops.
See the_date() in WordPress Codex for an explanation: SPECIAL NOTE: When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day, you should use the Template … Read more
Looks like you’re using the wrong query_var. It should be ‘paged’ $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 0;
if you set the fields parameter to ids you will get an array of ids instead of unneeded post data ex: $ongoing_args = array( ‘post_type’ => ‘promotions’, ‘meta_key’ => ‘sp_ongoingPromotion’, ‘meta_value’ => 1, ‘fields’ => ‘ids’ ); $current_args = array( ‘post_type’ => ‘promotions’, ‘meta_key’ => ‘sp_endDate’, ‘meta_value’ => date(“Y/m/d”), ‘meta_compare’ => ‘>=’, ‘orderby’ => ‘meta_value’, … Read more