Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Christopher Bessler

Forum Replies Created

Viewing 8 posts - 21 through 28 (of 28 total)
  • Christopher Bessler in reply to:
    Types 1.9 Breaks S&F Admin
    #37356

    Thanks for the great plugin and dedicated support.

    Christopher Bessler in reply to:
    Filter Query Args
    #37355

    Hi Ross,
    it appears that you are correct about get_queried_object being the issue.

    Yes pagination still works.

    When I enter hotels-motels as a static value everything appears to work properly.

    How do you go about saving get_queried_object from a template and using it in the filter function for S&F? Is there a way of filtering the query_args from within the template (or would that even help?)?

    Christopher Bessler in reply to:
    Filter Query Args
    #37268

    Update: pagination appears to be working.

    If Member Regions taxonomy on http://selkirkloop.org/wordpress/member-category/lodging/hotels-motels/ is dropped down the accurate count shows until an option is selected. As soon as an option is selected, the search reverts back to searching all posts instead of the filtered $current_member_category .

    Christopher Bessler in reply to:
    Filter Query Args
    #37257

    So the query filter only seems to work until a search is made or pagination is selected. See my link below. I am currently using S&F to display the posts.

    As soon as you make a search, it no longer filters by the current member-category. In this example only posts in hotels and motels are being queried until the search takes place.

    http://selkirkloop.org/wordpress/member-category/lodging/hotels-motels/

    Christopher Bessler in reply to:
    Filter Query Args
    #37242

    Ross,
    I just tested this and found that if I display results using the search.php then the filter can’t use the get_queried_object()->name; , but if I display results using the shortcode method within the same taxonomy template, the get_queried_object()->name; is usable for the query filter.

    Here’s what I currently have:

    function member_query_args( $query_args, $sfid ) {
    	
    	$current_member_category = get_queried_object()->name;
    	
      if($sfid==3906) {
    	 $query_args = array(
        'member-category' => $current_member_category
    	);
      }
      return $query_args;
    }
    
    add_filter( 'sf_edit_query_args', 'member_query_args', 10, 2 );
    Christopher Bessler in reply to:
    Filter Query Args
    #37240

    Hi Ross,
    thanks for all of the great input. Would this function run from the taxonomy-member-category.php template where the shortcode is placed or would it be happening on the search.php template? I believe the get_queried_object()->term_id; would only work if the query filter were taking place on the taxonomy-member-category.php template.

    Maybe it would work if the search never left taxonomy-member-category.php template. Is there a way of having search results display within the same page that the search is happening?

    Christopher Bessler in reply to:
    Filter Query Args
    #37173

    Hi Ross,
    the search is being performed from the taxonomy-member-category.php template. My whole goal is to be able to only search posts/content from within the current member-category.

    Christopher Bessler in reply to:
    Filter Query Args
    #37151

    OK,
    I’m able to get this to filter:

    function member_query_args( $query_args, $sfid ) {

    if($sfid==3906) {
    $query_args = array(
    ‘member-category’ => ‘hotels-motels’
    );
    }
    return $query_args;
    }

    How can I go about dynamically placing the value of member-category ?

    add_filter( ‘sf_edit_query_args’, ‘member_query_args’, 10, 2 );

Viewing 8 posts - 21 through 28 (of 28 total)