Reputation: 19
i am using below code to display all post through wordpress
page-- Its displaying the same code as it is-- Any help==
<?php
$wp_query = new WP_Query(array('post_type'=>'post', 'post_status'=>'publish',
'posts_per_page'=>10, 'paged'=>get_query_var('paged')));
?>
Or below one is also not working
<?php
$args = array( 'numberposts' => '8' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
echo '<li class="latesttrends"><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"].'</a> </li> ';
}
?>
Upvotes: 0
Views: 1367
Reputation: 533
$wp_query = query_posts( '&posts_per_page=-1' );
In $wp_query Array you will get all post.
Upvotes: 1