• Resolved champdor

    (@champdor)


    I have one filterable Pod which is a downloadable pdf.

    Filtering (Search & Filter Pro) works because the tags count is changing. But the loop displays all the items, not just the filter results. Try a search for ‘asdf’

    I use archive.php. The query is this:

    
    // Pulling PODS Loop instead of WP Loop
    $mypod = pods( 'szakmai_anyag' );
    /*$params = array(
    		'limit' => 2, /* get_option( 'posts_per_page', 14 ), /* Change to Posts per page 
    	); */
    $mypod->find();
    

    I think my find() could be a problem. I don’t know how to call it to list only the results.

    Can anybody help?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    As you can see in your code you’ve commented the $params array.
    Also, you are not passing the $params into find().

    Cheers, Jory

    Thread Starter champdor

    (@champdor)

    Jory,

    So you are suggesting that putting back the $params will do the trick:

    
    <?php echo do_shortcode( '[searchandfilter id="79"]' );
    
    // Pulling PODS Loop instead of WP Loop
    $mypod = pods( 'szakmai_anyag' );
    $params = array(
    	'limit' => 2, // to test pagination
    ); 
    $mypod->find( $params );
    	
    echo $mypod->pagination();	
    
    while ( $mypod->fetch() ) :
    	// loop items display works fine
    endwhile;
    

    Nope. Still pod is filtered as I can see in the changing of tags count but all the pod items are displayed by the loop. (Try selecting EN under ‘Nyelv’.)

    What am I missing:
    – Should I omit find()?
    – Should I give some kind of $param that find() could change the items list to reflect the results of the filtering?
    – Should I go back to WP_Query so Search&Filter could alter the results list in it?
    – Should I ask S&F support because my code is OK and this is a S&F issue?

    Please give some insight.

    Best regards,
    Champdor

    Plugin Author Jory Hogeveen

    (@keraweb)

    If you are trying to combine the S&F plugin with Pods then I doubt that will work properly.
    You are not filtering anything in the pods find query, just the number of items.

    You could try to fetch the params from S&F and pass them into Pods but as I am not familiar with that plugin I cannot help you there.

    I think in this case it’s better/easier to use WP_Query and other WordPress core functions.

    Cheers, Jory

    Thread Starter champdor

    (@champdor)

    Jory,

    Yes, it is the way. I managed to filter my pods with core WP functions. Thank Pods that it is compatible with WordPres CPTs. The only thing that I cannot use is Pods pagination and I will have to use WP Page Navi.

    Thank you for your help.

    Best regards,
    Champdor

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Pod filtered but displays all the items’ is closed to new replies.