Customizing Results Template Page
-
First of all congrats on the Plugin i have found it very useful for the website I have been working on and I have only heard good things about it. http://ww.wp.xz.cn/support/plugin/advanced-custom-post-search
Currently I am having a hard time customizing my results page and I have had the opportunity to see some of the threads about it and as far as I know we need to move the acps-results.php and acps-results_loop.php files into my themes folders. Either on the acps/templates folder route or the main directory of the theme folder. I also erased those two files from the plugin folder.
Here is how my files look:
acps-results.php:
<?php /*
Template Name: Causes Template
*/ ?><?php get_header(); ?>
<div id=”primary” class=”content-area”>
<div id=”content” class=”site-content” role=”main”><?php
while ( have_posts() ) : the_post();//Content includes shortcode (only remove if you are calling it directly in your template)
the_content();endwhile;
//Reset postdata (avoid potential conflicts)
wp_reset_postdata();
?></div>
</div><?php get_footer(); ?>
acps-results_loop.php:
<?php
//New results loop
$acps_results = new WP_Query( $this->acps_args );
$template = get_option(‘STL Springboard’);
$search = ( isset($this->acps_args[‘s’]) ) ? true : false ;//Standard loop
if( $acps_results->have_posts() ): ?><?php $acps_result_label = ($acps_results->post_count > 1) ? ‘Results’ : ‘Result’; ?>
<header class=”page-header”>
<?php if( $search ): ?>
<h1 class=”page-title”><?php printf( __( ‘%s Search %s for: %s’, ‘acps’ ), $acps_results->post_count, $acps_result_label, $this->acps_args[‘s’] ); ?></h1>
<?php else: ?>
<h1 class=”page-title”><?php _e(‘Search Results’,’acps’);?></h1>
<?php endif; ?>
</header><?php while( $acps_results->have_posts() ) : $acps_results->the_post(); ?>
<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<?php if( has_post_thumbnail() ): ?>
<?php if( $template != ‘STL Springboard’ ): ?>
<div class=”entry-header”>
<?php endif; ?>
<div class=”entry-thumbnail”>
“>
<?php the_post_thumbnail(); ?>
</div>
<?php if( $template != ‘STL Springboard’ ): ?>
</div>
<?php endif; ?>
<?php endif; ?><?php if( $template == ‘STL Springboard’ ): ?>
<header class=”entry-header”>
<?php endif; ?><div class=”entry-meta”>
<?php the_title( ‘<h2 class=”entry-title”>‘, ‘</h2>’ );if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
?><span class=”comments-link”><?php comments_popup_link( __( ‘Leave a comment’, ‘acps’ ), __( ‘1 Comment’, ‘STL Springboard’ ), __( ‘% Comments’, ‘STL Springboard’ ) ); ?></span>
<?php
endif;edit_post_link( __( ‘Edit’, ‘acps’ ), ‘<span class=”edit-link”>’, ‘</span>’ ); ?>
</div>
<footer>
<?php if( $template == ‘STL Springboard’ ): ?>
</footer>
</header>
<?php endif; ?><div class=”entry-summary”>
<?php the_excerpt(); ?>
</div><?php the_tags( ‘<footer class=”entry-meta”><span class=”tag-links”>’, ”, ‘</span></footer>’ ); ?>
</article>
<?php
endwhile;
else:
?><header class=”page-header”>
<h1 class=”page-title”><?php _e( ‘Nothing Found’, ‘acps’ ); ?></h1>
</header><div class=”page-content”>
<p><?php _e( ‘Sorry, but nothing matched your search terms. Please try again with some different keywords.’, ‘acps’ ); ?></p>
<?php echo do_shortcode(‘[acps id=”‘.$this->acps_form_id.'”]’); ?>
</div><?php
endif;
?>The results page works and can find things but does not adjust to my theme. Any advice?
ps I would be happy to send you a private message with the link to the results page. Thanks!
The topic ‘Customizing Results Template Page’ is closed to new replies.