Forums › Forums › Search & Filter Pro › Search Custom Post Types, not working
Tagged: search
- This topic has 1 reply, 1 voice, and was last updated 6 years, 10 months ago by Anonymous.
-
Anonymous(Private) January 17, 2018 at 6:15 am #152948
Hello
Currently, when I create a custom post type search locally my query works but once I have ported it over to my server it doesn’t, and I can’t seem to find out why? I have tried multiple variations of this that I have found online.
Here is my Code-
<?php
$args = array
(‘post_type’ => ‘Reports’,
‘search_filter_id’ => 5647
);
$query = new WP_Query( $args );
if( $query->have_posts() ) : while( $query->have_posts()) : $query->the_post(); ?>
<div class=”result “>
” class=”result”>
<div class=”reports-links”>
<div class=”report-grid1-3″>
<div class=”report-title”>
<p>report number</p>
<h4><?php echo the_field(‘report_number’); ?></h4>
</div>
</div>
<div class=”report-grid2-3″>
<div class=”report-title”>
<p>Date of issue</p>
<h4><?php the_field(‘report_date’); ?></h4>
</div>
</div>
</div>
<!– #post-## –>
</div>
<?php endwhile; ?>
<?php else : ?>
<div class=”no-posts “>
<h3 class=”text-center”>
<?php _e( ‘Something went wrong, please search the exact report number.’ ); ?>
</h3>
</div>
<?php endif; wp_reset_postdata(); ?>the site is currently live at https://www.icagemlab.com
The search input that relates to this code is in the header to the right of the logo “report verification”
Thank you for your time in advance
Rob
-
AuthorPosts