Forums › Forums › Search & Filter Pro › Custom Post Type only displaying 1 result
Tagged: cpt, custom taxonomy, results
- This topic has 17 replies, 2 voices, and was last updated 9 years, 1 month ago by
Trevor.
-
Anonymous(Private) June 3, 2016 at 4:51 pm #47426
Oh and here is the link to my page: http://realhopeforcdh.com/cms/survivors/
Trevor(Private) June 3, 2016 at 5:28 pm #47429This:
<?php echo do_shortcode('[searchandfilter id="423" fields="ecmo, lhr_ratio, side, liver" all_items_labels=",ECMO Required, All LHR, CDH side, Liver Orientation"]'); ?>
Is not a valid shortcode for the Pro version?
(Also note that I put this code inside code tags?)
Trevor(Private) June 3, 2016 at 6:01 pm #47435OK
I have enabled
Enable Auto Count
and in each field enabledDisplay count
just so I can better see what is going on.The template search.php is called content.php and that is overriding the results.
I cannot see how you got the search form to appear?
Did you also try the shortcode display results method?
Anonymous(Private) June 3, 2016 at 6:04 pm #47436Ah sorry I should have explained, the search.php pulls in the content-blog-list.php so the results appear the same as the post list.
Search.php
<!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <?php wp_head(); ?> </head> <body <?php body_class(); ?> <?php hybrid_attr( 'body' ); ?>> <div id="page" class="site"> <div class="headbar"> <div class="logo-image"><img src="http://realhopeforcdh.com/cms/wp-content/uploads/2016/05/real-hope-logo.jpg"></div> </div> <div class="search-area"> <div class="wide-container"> <?php get_search_form(); // Loads the searchform.php template. ?> </div> </div> <?php get_template_part( 'menu', 'primary' ); // Loads the menu-primary.php template. ?> <!--END HEADER--> <div id="content" class="site-content"> <div class="wide-container"> <div id="primary" class="content-area"> <center> <?php echo do_shortcode('[searchandfilter id="423"]'); ?> </center> <main id="main" class="site-main list" role="main" <?php hybrid_attr( 'content' ); ?>> <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> </div> <div> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p><br /><?php the_excerpt(); ?><p> <?php if ( has_post_thumbnail() ) { echo '<p>'; the_post_thumbnail("small"); echo '</p>'; } ?> </div> <hr /> </div> </div> <?php get_footer(); ?>
and content-blog-list.php
<!---TITLE What shows before click --> <div class="collapseomatic noarrow" id="<?php the_ID(); ?>" title="Trigger 1"> <div class="mid-line"> <h2><?php the_title(); ?></h2></div> <div class="post-image"> <?php the_post_thumbnail( 'large', array( 'class' => 'entry-thumbnail', 'alt' => esc_attr( get_the_title() ) ) ); ?> </div> </div> <!---END What shows before click --> <!---TITLE What shows AFTER click --> <div id='swap-<?php the_ID(); ?>' style='display:none;'> <div class="mid-line"> <h2><?php the_title(); ?></h2></div> <div class="post-image"> <?php the_post_thumbnail( 'large', array( 'class' => 'entry-thumbnail', 'alt' => esc_attr( get_the_title() ) ) ); ?> </div> </div> <!---END What shows after click --> <!---BEGIN EXCERPT What shows before click --> <div id="excerpt-<?php the_ID(); ?>" class="collapseomatic_excerpt "><?php the_excerpt(); ?> <div class="collapseomatic noarrow" id="<?php the_ID(); ?>" title="Trigger 1"><div class="toggle-read-more">Read More</div></div> <hr> </div> <!---END What shows before click --> <!---BEGIN CONTENT What shows before click --> <div id="swapexcerpt-<?php the_ID(); ?>" style="display:none;"> <?php the_content(); ?> <?php echo do_shortcode('[ssba]'); ?> <div class="grad-info"> <h2 class="alignleft">CDH diagnosis</h2> <table> <tr> <td><span>ECMO Required: </span></td> <td><span><?php the_field('ecmo_required'); ?></span></td> </tr> <tr> <td><span>CDH Side: </span> </td> <td><span><?php the_field('left_or_right_side'); ?></span></td> </tr> <tr> <td><span>Liver Orientation: </span></td> <td><span><?php the_field('liver_up_or_liver_down'); ?></span></td> </tr> <tr> <td><span>LHR: </span></td> <td><span><?php the_field('lung_to_head_ratio'); ?></span></td> </tr> </table> </div> <div class="collapseomatic noarrow" id="<?php the_ID(); ?>" title="Trigger 1"><div class="toggle-read-less"> Read Less</div></div> </div> <!---END What shows after click -->
Anonymous(Private) June 3, 2016 at 6:22 pm #47439Sorry again, I’ve told you wrong. I’ve been messing with this for hours and I’ve lost all sense of reality. You are right, Im not sure how the results are being shown like this. I originally had it set up with the search.php like this:
<?php /** * Template Name: Blog List Template */ get_header(); ?> <div id="primary" class="content-area"> <center> <?php echo do_shortcode('[searchandfilter id="423" fields="ecmo, lhr_ratio, side, liver" all_items_labels=",ECMO Required, All LHR, CDH side, Liver Orientation"]'); ?> </center> <main id="main" class="site-main list" role="main" <?php hybrid_attr( 'content' ); ?>> <?php $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; $args = apply_filters( 'bulan_blog_list_query', array( 'post_type' => 'graduates', 'paged' => $paged ) ); ?> <?php $wp_query = new WP_Query( $args ); ?> <?php if ( $wp_query->have_posts() ) : ?> <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> <?php if ( is_sticky() ) : ?> <?php get_template_part( 'content', 'home' ); ?> <?php else : ?> <?php get_template_part( 'content', 'blog-list' ); ?> <?php endif; ?> <?php endwhile; ?> <?php get_template_part( 'loop', 'nav' ); // Loads the loop-nav.php template ?> <?php else : ?> <?php get_template_part( 'content', 'none' ); ?> <?php endif; wp_reset_postdata(); ?> </main><!-- #main --> </div><!-- #primary --> <?php get_footer(); ?>
Which was giving the results that we are seeing now…
Maybe I should scrap the whole thing and start fresh.
-
AuthorPosts