Forums Forums Search & Filter Pro Help with displaying result of custom post type

Viewing 9 posts - 1 through 9 (of 9 total)
  • Anonymous
    #220566

    Hi!

    Please help, very little knowledge about codding.

    I am using Salient WP theme. I made a custom post named certified_ngo with a custom template for it’s archive page. I need help in displaying it’s result with the same template I made and not the default salient template.

    How do I go about this? I looked at the documentation and I’m guessing I should set it up using the Custom option https://searchandfilter.com/documentation/search-results/custom/ Is this correct?

    It says
    -Attach Search & Filter to a query
    -Enter the results URL where the query/results will be found

    How do I exactly do those steps? Which php files should I need to edit?

    Please help thanks

    Anonymous
    #220567
    This reply has been marked as private.
    Trevor
    #220587

    Could you upload the PHP template file for that page to a file sharing site and share the link for that with me so that I can look at it?

    Anonymous
    #220704
    This reply has been marked as private.
    Anonymous
    #220706
    This reply has been marked as private.
    Trevor
    #220782

    Ah, OK.

    I think you should use our Shortcode method instead. See here and also follow the guide for customising:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/

    Then, either edit the results.php file yourself, or contact me and I will edit the results.php file for you. I think the content needs to be like this:

    if ( $query->have_posts() )
    {
    	?>
    	
    	<div class="ngo-list">	
    		<div class="table">
    				
                <table>
                    <tr>
    					<th>Name</th>
    					<th>Category </th>
    					<th>Website </th>
    					<th>Learn More </th>
    				</tr>
    	
    	<?php
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
                    <tr>
    					<td><h5 class=""><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5></td>
    					<td><?php $term = get_field('ngo_category'); echo get_term($term)->name; ?></td>
    					<td><a href="<?php the_field('website'); ?>"><?php the_field('website'); ?></a></td>
    					<td><a href="<?php the_permalink(); ?>">View Details</a></td>
    				</tr>
    		<?php
    	}
    	echo paginate_links();
    	
    } ?>
                </table>
    					
            </div>
    	</div>	
    
    ?>
    Trevor
    #220784
    This reply has been marked as private.
    Anonymous
    #220836

    Hi Trevor,

    I tried the method you’ve given and it worked! Thank you so much for your fast response and help. I appreciate it greatly.

    Problem solved, thanks!

    Trevor
    #220840

    That’s great to hear. I will close this thread for now.

Viewing 9 posts - 1 through 9 (of 9 total)