Exemplo n.º 1
0
 function get_latest_posts()
 {
     global $post_request_ajax;
     $load_time = $_GET['load_time'];
     $frontpage = $_GET['frontpage'];
     $num_posts = 10;
     // max amount of posts to load
     $number_of_new_posts = 0;
     $visible_posts = isset($_GET['vp']) ? (array) $_GET['vp'] : array();
     query_posts('showposts=' . $num_posts . '&post_status=publish');
     ob_start();
     while (have_posts()) {
         the_post();
         $current_user_id = get_the_author_meta('ID');
         // Avoid showing the same post if it's already on the page
         if (in_array(get_the_ID(), $visible_posts)) {
             continue;
         }
         // Only show posts with post dates newer than current timestamp
         if (get_gmt_from_date(get_the_time('Y-m-d H:i:s')) <= $load_time) {
             continue;
         }
         $number_of_new_posts++;
         $post_request_ajax = true;
         p2_load_entry(false);
     }
     $posts_html = ob_get_clean();
     if ($number_of_new_posts != 0) {
         nocache_headers();
         echo json_encode(array('numberofnewposts' => $number_of_new_posts, 'html' => $posts_html, 'lastposttime' => gmdate('Y-m-d H:i:s')));
     } else {
         nocache_headers();
         header('HTTP/1.1 200 OK');
         exit;
     }
 }
Exemplo n.º 2
0
 */
?>
<?php get_header(); ?>
<?php $tag_obj = $wp_query->get_queried_object(); ?>

<div class="sleeve_main">

	<div id="main">
		<h2><?php printf( __( 'Tagged: %s', 'p2' ), single_tag_title( '', false) ); ?> <a class="rss" href="<?php echo get_tag_feed_link( $tag_obj->term_id ); ?>">RSS</a></h2>

		<?php if ( have_posts() ) : ?>

			<ul id="postlist">
			<?php while ( have_posts() ) : the_post(); ?>

				<?php p2_load_entry(); // loads entry.php ?>

			<?php endwhile; ?>
			</ul>

		<?php else : ?>

			<div class="no-posts">
			    <h3><?php _e( 'No posts found!', 'p2' ); ?></h3>
			</div>

		<?php endif ?>

		<div class="navigation">
			<p class="nav-older"><?php next_posts_link( __( '&larr; Older posts', 'p2' ) ); ?></p>
			<p class="nav-newer"><?php previous_posts_link( __( 'Newer posts &rarr;', 'p2' ) ); ?></p>
Exemplo n.º 3
0
echo get_tag_feed_link($tag_obj->term_id);
?>
">RSS</a></h2>
	
		<?php 
if (have_posts()) {
    ?>
			
			<ul id="postlist">
			<?php 
    while (have_posts()) {
        the_post();
        ?>
				
				<?php 
        p2_load_entry();
        ?>
			
			<?php 
    }
    ?>
			</ul>
		
		<?php 
} else {
    ?>
		
			<div class="no-posts">
			    <h3><?php 
    _e('No posts found!', 'p2');
    ?>
Exemplo n.º 4
0
	<?php endif; ?>
	<div id="main">

		<?php if ( have_posts() ) : ?>

		<h2>
			<?php printf( _x( 'Updates from %s', 'Author name', 'p2' ), p2_get_archive_author() ); ?>

			<span class="controls">
				<a href="#" id="togglecomments"> <?php _e( 'Toggle Comment Threads', 'p2' ); ?></a> | <a href="#directions" id="directions-keyboard"><?php _e( 'Keyboard Shortcuts', 'p2' ); ?></a>
			</span>
		</h2>

		<ul id="postlist">
			<?php while ( have_posts() ) : the_post(); ?>
	    		<?php p2_load_entry(); ?>
			<?php endwhile; ?>
		</ul>

		<?php else : ?>

		<h2><?php _e( 'Not Found', 'p2' ); ?></h2>
		<p><?php _e( 'Apologies, but the page you requested could not be found.', 'p2' ); ?></p>

		<?php endif; // end have_posts() ?>

		<div class="navigation">
			<p class="nav-older"><?php next_posts_link( __( '&larr; Older posts', 'p2' ) ); ?></p>
			<p class="nav-newer"><?php previous_posts_link( __( 'Newer posts &rarr;', 'p2' ) ); ?></p>
		</div>