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 8 years, 6 months ago by Trevor.
-
Anonymous(Private) June 3, 2016 at 4:50 pm #47425
Hi there, been reading through the other threads about the issue with CPT, but I think mine might be a little different and I am pulling my hair out over it.
First of all, great plugin, and great support! I bought pro a while ago because I believe in supporting good plugins.
So I have a custom search results page, code is below:
`<!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”></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″ 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’ ); ?>>
<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>“><?php the_title(); ?></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(); ?>
‘I have the Collapse-o-matic plugin incorporated in the content portion, but it works successfully on my posts page, its only when I try to filter the results based on a custom taxonomy that it displays one post…
Any ideas? Thanks in advance
Anonymous(Private) June 3, 2016 at 4:51 pm #47426Oh 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 -->
-
AuthorPosts