Forums › Forums › Search & Filter Pro › auto open media and pagination
- This topic has 7 replies, 2 voices, and was last updated 4 years, 2 months ago by Trevor.
-
Anonymous(Private) September 1, 2020 at 8:47 pm #258030
On our site https://theescogroup.com/sds/ we would like to have the PDFs auto open rather than take you to a new page with a small image of the PDF that you then have to click to open. Also is there a way to change to numbered pagination rather than the page 1 of 2?
Trevor(Private) September 4, 2020 at 10:01 am #258483I apologise for the delay, I ran out of time yesterday.
If you haven’t already done so, can you follow this guide:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
In particular, follow the instructions in the Customising section.
That will give you a
results.php
file you can edit, in a sub-folder namedsearch-filter
in your theme folder.To make the pagination look nicer, install the free WP-PageNavi plugin and delete these lines in the results.php template file:
<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>
To show only a link to the pdf itself, replace these lines:
<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>'; } ?> <p><?php the_category(); ?></p> <p><?php the_tags(); ?></p> <p><small><?php the_date(); ?></small></p>
With this:
<h2><a href="<?php echo esc_url(wp_get_attachment_url(get_the_ID () , false )); ?>"><?php the_title(); ?></a></h2>
-
AuthorPosts