
ដើម្បីរចនារបារមាតិកា (menu) យើងចាំបាច់ត្រូវបើកឯកសារឈ្មោះ header.php នៅក្នុងថតដែលជាគំរូគេហទំព័រ Underscores របស់យើង។ បន្ទាប់មកទៀត យើងត្រូវសរសេរកូដ CSS នៅក្នុងឯកសារ header.php នោះដូចខាងក្រោមនេះ៖
<?php /** * The header for our theme * * This is the template that displays all of the section and everything up until* * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * * @package Lotus_Blue */ ?> <!doctype html> <html <?php language_attributes(); ?>> <head> <link href='https://fonts.googleapis.com/css?family=Oswald|Bokor|Bayon|Koulen|Moul|Nokora|Hanuman|Metal' rel='stylesheet'> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <style> a:link { text-decoration:none; } .region{ width: 950px; margin: 20px auto 0; } body{ font: 14px/1.5 Hanuman; background: #bbbfc4; } .site{ background: #dde2eb; padding: 20px; border-radius: 4px; } .site-branding{ background: #124094; padding: 25px 15px 20px; text-align: center; } .site-title{ margin:0; } .site-title a{ font: 36px/1.5 Moul; color: white; } .site-description{ color: white; font: italic 18px/1.5 Nokora; margin-bottom:0; } /*ការរចនារបារមាតិកា*/ .main-navigation{ background: #3973db; } ul.nav-menu{ padding: 8px 0; font: 14px/1.5 Bayon; } ul.nav-menu li { display: inline-block; float: none; position: relative; margin-left: 10px; } ul.nav-menu a{ color: lavender; } ul.nav-menu a:hover{ color: white; } /*ការរចនាសំរាប់ទូរស័ព្ទដៃ*/ @media only screen and (max-width : 768px) { .region{ width: 100%; margin: 0; } ul.nav-menu li{ display: block; margin-right: 0px; padding: 3px 0; } ul.nav-menu{ padding: 8px 0; font: 14px/1.5 Hanuman; } } </style> <div id="page" class="site region"> <?php esc_html_e( 'Skip to content', 'lotus-blue' ); ?> <header id="masthead" class="site-header"> <div class="site-branding"> <?php the_custom_logo(); if(is_front_page() && is_home()): ?></header> <div id="content" class="site-content"><?php bloginfo( 'name' ); ?>
<?php else : ?> <?php endif; $lotus_blue_description = get_bloginfo( 'description', 'display' ); if( $lotus_blue_description || is_customize_preview() ) : ?><?php echo $lotus_blue_description; /* WPCS: xss ok. */ ?>
<?php endif; ?>
ចាប់ពីបន្ទាត់លេខ 62 ដល់ 80 គឺជាកូដ CSS ចាំបាច់សំរាប់រចនារបារមាតិកា។
ចាប់ពីបន្ទាត់លេខ 87 ដល់បន្ទាត់លេខ 95 គឺកូដ CSS ចាំបាច់សំរាប់រចនារបារមាតិកាសំរាប់ទូរស័ព្ទដៃ។