Sindbad~EG File Manager
<?php
/*
* Security : blocking direct access
* Source : http://codex.wordpress.org/Theme_Development#Template_Files
*/
defined('ABSPATH') or die("Access Restricted");
/*
* Function Description : Load More Posts with AJAX
* Author : Mouad Achemli
* Function Source : http://www.mwordpress.net
* Note : this function is important do not remove from here
* Ajax call in : /archives.php
*/
function load_more_custom_archive(){
global $post;
$paged = esc_attr($_GET['paged'] + 1);
$per_page = esc_attr($_GET['post_per_page']);
$args = array(
'post_status' => 'publish',
'posts_per_page' => $per_page,
'paged' => $paged
);
$archive_page_query = new WP_Query($args);
$output = '';
?>
<table class="table">
<tbody class="ajax-tbody-content">
<?php while ($archive_page_query->have_posts()) : $archive_page_query->the_post(); ?>
<tr class="hentry">
<td><?php mwp_smart_thumb('mwp-small', $post->ID, 280, 160); ?></td>
<td class="maxed entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></td>
<td><span class="btn btn-success btn-sm"><?php the_time('j M, Y'); ?></span></td>
<td class="cat"><?php $category = get_the_category(); echo '<a class="cat-author btn btn-info btn-sm" href="'.esc_url(get_category_link($category[0]->term_id )).'">'.esc_attr($category[0]->cat_name).'</a>'; ?></td>
<?php mwp_meta_hidden_table(); ?>
</tr>
<?php endwhile; ?>
</tbody>
</table>
<?php
wp_reset_postdata();
die($output);
}
add_action( MWP_AJAX_PREFIX . '_load_more_custom_archive', 'load_more_custom_archive');
add_action( MWP_AJAX_PREFIX . '_nopriv_load_more_custom_archive', 'load_more_custom_archive');
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists