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.

danriverdigital

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • danriverdigital in reply to:
    Exclude current post from results
    #184385

    Hi Ross,

    Thank you for this, it worked straight away.

    Dan

    danriverdigital in reply to:
    Exclude current post from results
    #184279

    Hi Trevor,

    I have specified the post type in the search form setup but sadly the code didn’t work.

    I am showing the results using a shortcode, would that make any difference?

    Thanks

    danriverdigital in reply to:
    Exclude current post from results
    #183959

    Sadly that hasn’t worked.

    I am using a custom post type called artist though so do I not need to specify that too?

    Thanks

    danriverdigital in reply to:
    Exclude current post from results
    #183892

    Hi,

    Below is the code snippet I have used but it doesn’t seem to be working. I get ‘No results found’. Can you see anything obviously wrong with it?

    function filter_function_name( $query_args, $sfid ) {
    
    	//if search form ID = 264, the do something with this query
    	if($sfid==264) {
    		//modify $query_args here before returning it
    		// $query_args['somearg'] = 'newvalue';
    		$postid = get_the_ID();
    		$query_args = array(
    			'post_type' => 'artist',
    			'post__not_in' => $postid,
    		);
    	}
    
    	return $query_args;
    }
    add_filter( 'sf_edit_query_args', 'filter_function_name', 20, 2 );
    danriverdigital in reply to:
    Multiple result templates for the same post type
    #169609

    I think I have managed to figure it out (I should’ve been more patient). I wasn’t using the Post Meta options properly. I have now set it as follows:

    featured (my ACF meta) – char – equals – 0

    So this form now returns all results that aren’t featured

    danriverdigital in reply to:
    Multiple result templates for the same post type
    #169606

    Okay thank you. I am using the shortcode method so it appears to be working so far.

    I have another question though. I followed your instructions on another post about creating featured posts (https://support.searchandfilter.com/forums/topic/featured-posts/). I have got one of the search forms displaying the featured posts, is there a way to hide featured posts from another search form?

    It seems the Post Meta options in Settings & Defaults might do what I am after but I can’t seem to get it to work.

    Thanks

Viewing 6 posts - 1 through 6 (of 6 total)