Forums › Forums › Search & Filter Pro › Category search
Tagged: category
- This topic has 50 replies, 2 voices, and was last updated 7 years, 1 month ago by Trevor.
-
Trevor(Private) October 16, 2017 at 3:21 pm #136775
I have a sample results.php for you, but as I can’t test it, I don’t know if it will work:
<?php /* Blog Style A */ 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 /> <?php while ($query->have_posts()) { $query->the_post(); $cb_post_id = $post->ID; ?> <article id="post-<?php the_ID(); ?>" <?php post_class('cb-blog-style-a cb-module-e cb-separated clearfix'); ?>> <div class="cb-mask cb-img-fw" <?php cb_img_bg_color( $cb_post_id ); ?>> <?php cb_thumbnail( '260', '170' ); ?> <?php cb_review_ext_box( $cb_post_id ); ?> </div> <div class="cb-meta clearfix"> <h2 class="cb-post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php cb_byline( $cb_post_id ); ?> <div class="cb-excerpt"><?php echo cb_clean_excerpt( 160 ); ?></div> <?php cb_post_meta( $cb_post_id ); ?> </div> </article> <?php } cb_page_navi( $cb_qry ); } wp_reset_postdata(); ?>
Trevor(Private) October 21, 2017 at 7:39 pm #137718If I look at a typical page, our form javascript etc is not loading. How have you incorporated the results.php I gave you to the site? Is the form setup as a Shortcode Display Results method, as described here:
https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/
Trevor(Private) October 22, 2017 at 11:23 am #137798Bear in mind I am working a bit blind here?
This should remove the bits you din’t want, and enable our infinite scroll:
<?php /* Blog Style A */ if ( $query->have_posts() ) { ?> <div class='search-filter-results-list'> <?php while ($query->have_posts()) { $query->the_post(); $cb_post_id = $post->ID; ?> <div class='search-filter-result-item'> <article id="post-<?php the_ID(); ?>" <?php post_class('cb-blog-style-a cb-module-e cb-separated clearfix'); ?>> <div class="cb-mask cb-img-fw" <?php cb_img_bg_color( $cb_post_id ); ?>> <?php cb_thumbnail( '260', '170' ); ?> <?php cb_review_ext_box( $cb_post_id ); ?> </div> <div class="cb-meta clearfix"> <h2 class="cb-post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php cb_byline( $cb_post_id ); ?> <div class="cb-excerpt"><?php echo cb_clean_excerpt( 160 ); ?></div> <?php cb_post_meta( $cb_post_id ); ?> </div> </article> </div> <?php } ?> </div> <?php // cb_page_navi( $cb_qry ); } else { ?> <div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'> <span>End of Results</span> </div> <?php } //wp_reset_postdata(); ?>
A couple of lines are disabled because I think that they are not needed.
Anonymous(Private) October 22, 2017 at 7:39 pm #137861Infinite scroll works good, and the top doesn’t show the number of results as requested. The only thing that didn’t work was removing the line at bottom of pics (cb-mask) but I changed its color to transparent with css, and adjusted all the other visual things so it looks exactly as the other version. Should the cb-mask be removed from the code as it doesn’t work though? Apart from that all good! Thank you
-
AuthorPosts