wordpress define template name 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: wordpress define template name
/*on top of Php file add the below line to make as custom template*/