I have created this function in bp-custom.php page.
function filtering_activity_default( $query ) {
if ( empty( $query ) && empty( $_POST ) ) {
$query = 'action=activity_update,joined_group';
}
return $query;
}
add_filter( 'bp_ajax_querystring', 'filtering_activity_default', 999 );
This is working for me as expected.
Related Posts:
- AJAX with loop filtering categories
- Exclude filter on front page
- Filtering The Loop For Single Page and Blog Page
- Sort Posts By Category?
- Custom search form to display users only
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- Query posts if meta key starts with
- How to return only one instance of each, from the entire loop
- Query reset problem or flawed code to enable custom post type query
- Combining action and filter?
- Filter the loop by categories using checkbox form
- Filter the_posts doesn’t work on search page
- Trying to get property of non-object in shortocde
- custom post on homepage
- Make a loop to return x number of posts, but only if they have content or excerpt
- Filter existing hook using parameter and foreach loop
- Use BuddyPress data in loop (mkdir)
- Loop order issue with Ajax filter
- Add Search and Filter functionality to custom loop
- Reorder posts in a loop: have the posts by one particular author below the others
- How to filter get previous post function by meta value DESC and post date DESC?
- WordPress redundant posts based on meta field
- Remove posts_orderby filter then add it back in
- get_posts and wp_autop (remove filter)
- Help with add_filter(‘the_content’, ‘some_function’) and multiple matches
- Applying a filter to multiple loops for days ago
- Get post content from outside the loop
- Using the Loop to show all levels of subpages under a parent page? Halfway there
- Cleanest Way to Select Every Second Element in a Loop?
- How to Change Loop to Order Posts by Views (using wp-postviews plugin)
- is_home, and is_front_page conditional problem
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- Display subpages under parent page as a list within a loop
- When to use wp_reset_postdata();
- Why do themes have `while( have_posts() )` in templates like single.php?
- Display only text to WordPress loop without loosing the text formatting
- Related Posts loop – offset
- Too many nested wp_query loops in this hypothetical query?
- pop-up lighbox with AJAX
- Showing current subcategory
- Display date only once for a each set of posts relating to that date
- WordPress Loop – Style rows of posts differently
- Generating dynamic Tabs with multiple query post loop
- How do I override part of the main loop in my child theme?
- Chopping up a large ajax request of around 200 posts [closed]
- Combining the_excerpt with the_content
- Only display videos and images in the_content() within loop
- Get search.php results in header.php?
- Recent posts on a static home page
- Query last updated posts (posts updated in the last 24 hours)
- I write simple wordpress loop for taxonomy.php file but don’t show result
- Publish Categories for a particular Author on a given Post
- How to hook into container
- How to add a specific div element to the first post in a row?
- Need to add class to first element in a foreach loop
- Scrolling Posts with Ajax
- Sort posts by first letter in the title, not by first number
- What PHP Needed to Make One Loop with Multiple Styling?
- Simple foreach loop help needed in wordpress “the loop”
- Get paged outside of loop?
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Show scheduled posts in loop (but don’t link to them)?
- How to get a count of all posts in foreach loop and split into fourths
- How to loop through yoast primary categories? [closed]
- WordPress get post thumbnail url
- Three Column Loop
- Split loop into columns
- get_posts() forcing ignore sticky posts on main loop
- display post tags on single.php inside loop
- Custom content before post content
- Can’t get the previous and next posts permalink
- Adding first and last classes to three column layout in Bones boilerplate
- make diffrent template on last six post published
- Modifying a Loop to Show More
- Does search.php autofilter The Loop?
- How to check all items in a loop have post thumbnail?
- Page Navigation Outside the Loop
- How to make the following loop break/stop when it reaches 2 posts (custom post types called Topics)?
- Exclude posts without category from loop
- How to display post tag on each post? [closed]
- ACF: display custom filed of CPT into the loop
- Solved – Inserting content inside the WordPress loop
- How to add “NEW” badge on latest posts or published 3 days interval
- Show posts by tags excluding current post
- Adding options to loop
- Keep post format class with isotope filter
- Featured posts and the loop
- How to fix pagination for custom loops?
- Suppress the_content filter in a nested loop
- Trouble preventing duplicate posts between 2 loops on homepage
- Change the way wordpress outputs images or image galleries
- How can I access ‘key’ and ‘value’ from an array in a for loop?
- How to get current page id and compare it to looped pages inside the same page?
- posts_nav_link() not working on index.php
- Error in Wordprewss loop for page template [closed]
- Tags outside the loop
- wp_mail sending only once inside foreach loop
- How to use orderby on meta_value when using Pods custom database table storage
- How to set and retrieve cookies while in the loop