gary
8/30/2018 - 4:24 PM

Hacking Ajax load wp default template

Hacking Ajax load wp default template

<?php 
$uri = $_SERVER['REQUEST_URI'];
if(preg_match('/repeater=team/', $uri, $matches)){ ?>

    <?php $image = get_the_post_thumbnail_url( get_the_ID() , 'medium'); ?>
    <div class="col-12 col-sm-6 col-md-3 team-repeater">
        <div class="card news-card">
            <a href="<?php the_permalink(); ?>">
                <img class="card-img-top" src="<?php echo $image;?>" alt="Image for <?php echo get_the_title();?>">
                <div class="card-body">
        	         <p class="card-text date"><i class="far fa-calendar"></i> <?php echo get_the_date();?></p>
                     <h5 class="card-title title"><?php echo get_the_title();?></h5>
        	  	</div>
    	     </a>
         </div>
    </div>
    
<?php }else{ ?>

    <?php $image = get_the_post_thumbnail_url( get_the_ID() , 'medium'); ?>
    <div class="col-12 col-sm-6 col-md-3">
        <div class="card news-card">
            <a href="<?php the_permalink(); ?>">
                <img class="card-img-top" src="<?php echo $image;?>" alt="Image for <?php echo get_the_title();?>">
                <div class="card-body">
                     <p class="card-text date"><i class="far fa-calendar"></i> <?php echo get_the_date();?></p>
                     <h5 class="card-title title"><?php echo get_the_title();?></h5>
                </div>
             </a>
         </div>
    </div>
    
<?php } ?>