How View the WordPress latest post checkup code in home page?


Hi guys this the latest post view in home page only. In the single page not working this.

<?php

$u_time = get_the_time(‘U’);
$u_modified_time = get_the_modified_time(‘U’);

//Current Post Checkup Start
$week = date(‘W’);
$year = date(‘Y’);
$query = new WP_Query( ‘year=’ . $year . ‘&w=’ . $week );
//echo $query->current_post;

//if (($wp_query->current_post < 1)&&($u_modified_time == $u_time)) {

if (($query->current_post<=1)&&($wp_query->current_post < 1)) { ?>

<div>
<?php
$page_name = array(74);
$welcome_data = get_page($page_name[0]);
?>
<!– h1><a href=”<//?php echo get_permalink($welcome_data->ID); ?>”>Private Lessons</a></h1 –>
<?php
echo $welcome_data->post_content;
?>
</div><!– Special Box Content End –>

<?php } else { ?>

<?php }
//Current Post Checkup End
?>

This latest post code view only in home page.

Comments are closed.