auto open media and pagination

Forums › Forums › Search & Filter Pro › auto open media and pagination

Viewing 8 posts – 1 through 8 (of 8 total)
  • Anonymous
    #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
    #258089
    This reply has been marked as private.
    Anonymous
    #258115
    This reply has been marked as private.
    Trevor
    #258259
    This reply has been marked as private.
    Anonymous
    #258379
    This reply has been marked as private.
    Trevor
    #258483

    I 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 named search-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>

    Anonymous
    #258527

    that worked perfectly thanks!

    Trevor
    #258544

    Thanks for getting back to me. I will close this thread for now.

Viewing 8 posts – 1 through 8 (of 8 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.