Forums Forums Search & Filter Pro Can't make custom archive to work…

Viewing 10 posts - 1 through 10 (of 13 total)
  • Anonymous
    #152534

    Hello,
    so I use with custom template…
    Here my configuration:
    http://prntscr.com/i0ppzn
    http://prntscr.com/i0pqoc

    here the code inside search.php

    <?php get_header(); ?>
    <h1>Search.php</h1>
    <?php echo do_shortcode('[searchandfilter id="1793"]'); ?>
    
    <pre style="direction: ltr;text-align: left;">
    <?php print_r($_GET); ?>
    </pre>
    <div class="container" id="main">
        <div class="row">
            <div class="list">
            
            <?php
    
            $count_news = 0;
            $query = new WP_Query(array(
                "post_type" => "news",
               "search_filter_id" => 1793
            ));
            if ($query->have_posts()): while ($query->have_posts()): $query->the_post();
            $count_news++;
            ?>
            <div class="col-xs-4">
                <article <?php post_class(); ?>>
                        <?php if(has_post_thumbnail()): ?>
                        <img src="<?php the_post_thumbnail_url() ?>" class="img-responsive" />
                        <?php else: ?>
                        <img src="/wp-content/uploads/2018/01/slider_placeholder.jpg" class="img-responsive" />
                        <?php endif; ?>
                        <?php the_title("<h1 style='font-size:20px;font-weight:bold;'>", "</h1>"); ?>
                        <?php echo mb_substr(get_the_content(), 0, 150) . "..." ?>
                    </article>
            </div>
            <?php if($count_news % 3 == 0): ?>
            <div class="clearfix"></div>
            <?php endif; ?>
                <?php endwhile;
            endif; ?>
    <?php echo paginate_links() ?>    
            </div>
        </div>
    </div>
    <?php get_footer(); ?>

    can’t make it work…
    what I’m doing wrong?
    Thank you.

    Trevor
    #152550

    Did you try setting the Display Result Method to Custom?

    Anonymous
    #152555
    This reply has been marked as private.
    Trevor
    #152557

    There is a javscript error in the browser console?

    Anonymous
    #152559
    This reply has been marked as private.
    Trevor
    #152563

    mmm.

    One thing I can see in your template is this line:

    <?php echo mb_substr(get_the_content(), 0, 150) . "..." ?>
    

    Using get_the_content() will retrieve content with <p>...</p> around it, but applying the mb_substr will remove the end </p>, which means the content will broken.

    You would be better to read this:

    http://smallenvelop.com/limit-post-excerpt-length-in-wordpress/

    But I am not sure why the Ajax does not work. If you switch off Ajax, does it then work (with a page re-load)?

    Anonymous
    #152637
    This reply has been marked as private.
    Trevor
    #152645

    Whatever stops infinite scroll stops ajax (or vice versa). I would suspect a javascript file.

    It will take me a while to do, so it will have to be tomorrow, but I will use Chrome and adblock in the inspector to stop the loading of each js file in turn to check them all.

    Anonymous
    #152678
    This reply has been marked as private.
    Trevor
    #152680
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 13 total)