user1859847
user1859847

Reputation: 19

Display All post on one page in wordpress

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

Answers (1)

Arvind Pal
Arvind Pal

Reputation: 533

$wp_query = query_posts( '&posts_per_page=-1' );

In $wp_query Array you will get all post. 

Upvotes: 1

Related Questions