Forums Forums Search & Filter Pro Results Template using multiple PODS (custom post types)

Viewing 9 posts - 1 through 9 (of 9 total)
  • Anonymous
    #163096

    Hi , I use S&F to filter my PODS (custom posts) and it works great. I want to use S&F to give results for more than one custom post type at a time. In the example below I use it to show results in the Promotions POD, but I would prefer the results to include ‘Promotions’ AND ‘Posts’. I think it has something to do with WP Query but a bit lost how to edit this to work. Any ideas? Thanks …

    <?php
    global $post;
    $pod_name = 'Promotions';
    //get pods object
    $pods = pods( $pod_name, $post->ID );
    
    echo $pods->template("my_search_loop");
    
    ?>
    Anonymous
    #163097

    The full results code… `<?php
    /**
    * Search & Filter Pro
    *
    * Sample Results Template
    *
    * @package Search_Filter
    * @author Ross Morsali
    * @link http://www.designsandcode.com/
    * @copyright 2015 Designs & Code
    *
    * Note: these templates are not full page templates, rather
    * just an encaspulation of the your results loop which should
    * be inserted in to other pages by using a shortcode – think
    * of it as a template part
    *
    * This template is an absolute base example showing you what
    * you can do, for more customisation see the WordPress docs
    * and using template tags –
    *
    * http://codex.wordpress.org/Template_Tags
    *
    */

    if ( $query->have_posts() )
    {
    ?>

    Found <?php echo $query->found_posts; ?> Results<br />
    Page <?php echo $query->query[‘paged’]; ?> of <?php echo $query->max_num_pages; ?><br />

    <div class=”pagination”>

    <div class=”nav-previous”><?php next_posts_link( ‘Older posts’, $query->max_num_pages ); ?></div>
    <div class=”nav-next”><?php previous_posts_link( ‘Newer posts’ ); ?></div>
    <?php
    /* example code for using the wp_pagenavi plugin */
    if (function_exists(‘wp_pagenavi’))
    {
    echo “<br />”;
    wp_pagenavi( array( ‘query’ => $query ) );
    }
    ?>
    </div>

    <?php
    while ($query->have_posts())
    {
    $query->the_post();

    ?>

    <div class=”results-inline-search”>
    <?php
    global $post;
    $pod_name = ‘Promotions’;
    //get pods object
    $pods = pods( $pod_name, $post->ID );

    echo $pods->template(“my_search_loop”);

    ?>

    </div>

    <?php
    }
    ?>
    <br />Page <?php echo $query->query[‘paged’]; ?> of <?php echo $query->max_num_pages; ?><br />

    <div class=”pagination”>

    <div class=”nav-previous”><?php next_posts_link( ‘Older posts’, $query->max_num_pages ); ?></div>
    <div class=”nav-next”><?php previous_posts_link( ‘Newer posts’ ); ?></div>
    <?php
    /* example code for using the wp_pagenavi plugin */
    if (function_exists(‘wp_pagenavi’))
    {
    echo “<br />”;
    wp_pagenavi( array( ‘query’ => $query ) );
    }
    ?>
    </div>
    <?php
    }
    else
    {
    echo “No Results Found”;
    }
    ?>`

    Trevor
    #163109

    What Post Types is the Search & Filter form set to search in?

    Anonymous
    #163112

    I set it up originally to reference the Promotions post type. which works great. I then wanted to add ‘posts’ to the results. The posts are found in the results list. I can see that by the number of results returned in each search request, however the posts are not displayed at all as the template to display the results is not looking for ;Posts’, just ‘Promotions’.
    I hope that makes sense?
    Thanks

    Anonymous
    #163114

    Sorry I meant to add I have ticked Posts and Promotions in the form setup so it does now look in both areas.

    Trevor
    #163116

    I apologise that I did not check it before, but your license (for support and updates), appears to have expired?

    Anonymous
    #163119
    This reply has been marked as private.
    Trevor
    #163123
    This reply has been marked as private.
    Anonymous
    #163222
    This reply has been marked as private.
Viewing 9 posts - 1 through 9 (of 9 total)