wordpress add new for template code example
Example 1: create custom page template wordpress
/* make this file in template-parts folder
give file name as category_post.php */
'post',
'post_status' => 'publish',
'category_name' => 'wordpress',
'posts_per_page' => 5,
);
$arr_posts = new WP_Query( $args );
if ( $arr_posts->have_posts() ) :
while ( $arr_posts->have_posts() ) :
$arr_posts->the_post();
?>
>
$arr_posts,
)
);
endif;
?>
Example 2: create a custom page and call that page wordpress
I used "Editing Your Custom Page Template" method
reference:
https://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/