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.
Forums › Forums › Search & Filter Pro › Category search
Tagged: category
- This topic has 50 replies, 2 voices, and was last updated 6 years, 11 months ago by Trevor.
-
Trevor Moderator(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(); ?>
Dagmara Gomez(Private) October 17, 2017 at 2:48 pm #136948Great! I’ll try to test it and let you know 🙂 Thank you
Trevor Moderator(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/
Dagmara Gomez(Private) October 21, 2017 at 8:05 pm #137720Yes, right now I have the basic version of plugin running, not the pro. But yes I created a folder in the theme and displayed the results via shortcode on a test page.
Trevor Moderator(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.
Dagmara Gomez(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
Trevor Moderator(Private) October 22, 2017 at 10:54 pm #137889I think you can take it from here, make whatever changes you want and test. If it works, then that is great. It will not break anything.
Dagmara Gomez(Private) October 23, 2017 at 1:22 am #137903Thank you very much for your help 🙂 I appreciate it!
-
AuthorPosts
The topic ‘Category search’ is closed to new replies.