Answers for "get_posts all posts"

PHP
1

get all posts

$args = array(
  'numberposts' => 10,
  'post_type'   => 'book'
);
 
$latest_books = get_posts( $args );
Posted by: Guest on March-24-2021
1

get_posts category

$defaults_param = array(
				'numberposts'      	=> -1,
				'post_type'        	=> 'post',
				'category' 			=> 40 ,
				'suppress_filters'	=> false
			);
$get_featured_post = get_posts($defaults_param);
Posted by: Guest on January-04-2021

Browse Popular Code Answers by Language