Miriam, un membro di questo gruppo di lavoro, ci ha fatto il favore di scrivere questo tutorial perché controlla perfettamente l'argomento.
Esempio: creare un modello di pagina personalizzato in wordpress
/* make this file in template-parts folder
give file name as category_post.php */
/**
* Template Name: Category Custom Page
*/get_header();?><divid="primary"class="content-area"><mainid="main"class="site-main"role="main">$args=array('post_type'=>'post','post_status'=>'publish','category_name'=>'wordpress','posts_per_page'=>5,);$arr_posts=newWP_Query($args);if($arr_posts->have_posts()):while($arr_posts->have_posts()):$arr_posts->the_post();?><articleid="post-the_ID();?>"post_class();?>>if(has_post_thumbnail()):the_post_thumbnail();endif;?><headerclass="entry-header"><h1class="entry-title">the_title();?>h1>header><divclass="entry-content">the_excerpt();?><ahref="the_permalink();?>">Read Morea>div>article>endwhile;wp_pagenavi(array('query'=>$arr_posts,));endif;?>main>div>get_footer();?>
Apprezziamo che tu voglia aggiungere valore ai nostri contenuti informativi assistendo con la tua anzianità di illustrazione.