ទំព័រស្តាទិក (static) គឺជាបណ្តាទំព័រទាំងឡាយណា ដែលមានប្រភេទជា «page» ដែលខុសពីទំព័រមានប្រភេទជា «post» នៅក្នុងប្រព័ន្ធ WordPress ។ ហើយដើម្បីរចនាទំព័រស្តាទិកនេះ យើងត្រូវបើកឯកសារមានឈ្មោះថា page.php រួចសរសេរនៅក្នុងនោះនូវកូដមួយចំនួនដូចខាងក្រោមនេះ៖
<?php /** * The template for displaying all pages * * This is the template that displays all pages by default. * Please note that this is the WordPress construct of pages * and that other 'pages' on your WordPress site may use a * different template. * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package Lotus_Blue */ get_header(); ?> <?php if(!wp_is_mobile()){ get_template_part( 'template-parts/home', 'ad' ); } ?><?php get_sidebar(); get_footer();<?php while ( have_posts() ) : the_post(); get_template_part( 'template-parts/content', 'page' ); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) : //comments_template(); endif; endwhile; // End of the loop. ?>
បន្ទាប់មកទៀត យើងត្រូវបើកឯកសារឈ្មោះ content-page.php នៅក្នុងថតឈ្មោះ template-parts នៅសរសេរកូដមួយចំនួន នៅក្នុងឯកសារនោះ ដូចខាងក្រោមនេះ៖
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>><?php the_title( ' <?php lotus_blue_post_thumbnail(); ?>', '
' ); ?><?php the_content(); wp_link_pages( array( 'before' => '<?php if ( get_edit_post_link() ) : ?> <?php endif; ?> </article>' . esc_html__( 'Pages:', 'lotus-blue' ), 'after' => '', ) ); ?>