Forums Forums Search & Filter Pro Contents loads then loads again

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #204855

    Hello I have come across a issue where all my filter content loads in correctly. However if you click elsewhere or visit another window then return it loads in again.

    What would be causing this. Here is my template code

    get_header();
    
    ?>
    <div class="page-body style-light-bg">
    	<div class="post-wrapper">
    
            <div class="row row-parent col-std-gutter double-top-padding no-bottom-padding limit-width">
    
    <div class="col-lg-8">
    <div class="post-content style-light double-bottom-padding">
    		
    <tbody>
    <table>	
    
    <td>
         <p>File</p>
    </td>
    <td>
         <p>Name</p>
    </td>
    <td>
         <p>Language</p>
    </td>
    <td>
         <p>Publish Date</p>
    </td>
    <td>
         <p>Download</p>
    </td>
    
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <tr>
    
    <td>
         <img src="<?php the_field('file_icon'); ?>" />
    </td>
    <td class="ptitle">
        <a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a>
    </td>
    <td>
        <img src="<?php the_field('language'); ?>" />
    </td>
    <td>
        <?php the_field('publish_date'); ?>
    </td>
    <td>
        <a href="<?php the_field('download'); ?>" target="_blank">Download</a>
    </td>
    
    <?php endwhile; else : ?>
    <?php endif; ?>
    
    </tr>
    </table>
    </tbody>
    
    </div>
    </div>
    
    		<div class="col-lg-4">
       			<div class="uncol style-light">
          			<div class="uncoltable">
             			 <?php get_sidebar(); ?>
          			</div>
       			</div>
    		</div>
    	</div>
    	</div>
    </div>
    
    										
    <?php get_footer(); ?>
    Anonymous
    #204856
    Trevor
    #204888

    Ah, I think I can see. It is the structure of the template, and a few errors in the HTML. Try something like this:

    <?php
    get_header();
    
    ?>
    <div class="page-body style-light-bg">
    	<div class="post-wrapper">
    
            <div class="row row-parent col-std-gutter double-top-padding no-bottom-padding limit-width">
    
    <div class="col-lg-8">
    <div class="post-content style-light double-bottom-padding">
    		
    
    <?php if ( have_posts() ) : ?>
    <tbody class='search-filter-results-list'>
    <table>	
    <tr>
    <td>
         <p>File</p>
    </td>
    <td>
         <p>Name</p>
    </td>
    <td>
         <p>Language</p>
    </td>
    <td>
         <p>Publish Date</p>
    </td>
    <td>
         <p>Download</p>
    </td>
        
    <?php while ( have_posts() ) : the_post(); ?>
    </tr>
    <tr class='search-filter-result-item'>
    
    <td>
         <img src="<?php the_field('file_icon'); ?>" />
    </td>
    <td class="ptitle">
        <a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a>
    </td>
    <td>
        <img src="<?php the_field('language'); ?>" />
    </td>
    <td>
        <?php the_field('publish_date'); ?>
    </td>
    <td>
        <a href="<?php the_field('download'); ?>" target="_blank">Download</a>
    </td>
    
    <?php endwhile; else : ?>
    </tr>
    </table>
    </tbody>
    <?php endif; ?>
    
    </div>
    </div>
    
    		<div class="col-lg-4">
       			<div class="uncol style-light">
          			<div class="uncoltable">
             			 <?php get_sidebar(); ?>
          			</div>
       			</div>
    		</div>
    	</div>
    	</div>
    </div>
    
    										
    <?php get_footer(); ?>

    Then, I have edited the form for you:

    https://www.screencast.com/t/uFpF3rDL4MPg

    Anonymous
    #204904

    Hello, Your code messed up the layout of the page so I re-aranged this section which seemed to solve that:

    </tr>
    <?php endwhile; else : ?>
    <?php endif; ?>
    </tbody>
    </table>

    The other aterations and the changes you made under Ajax pagination fixed the issue I was having thankyou

    Trevor
    #204908

    I am pretty sure the end of tbody and table need to be before the endif? But, yes, the end of the tr was in the wrong place. I will close this thread for now.

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