រចនា​ក្បាល​គេហទំព័រ


នៅ​ក្នុង​ប្រព័ន្ធ WordPress ដើម្បី​រចនា​ក្បាលគេហទំព័ររ យើង​ចាំបាច់​ត្រូវ​បើក​ឯកសារ​ឈ្មោះ 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; } /*ការរចនា​សំរាប់​ទូរស័ព្ទ​ដៃ*/ @media only screen and (max-width : 768px) { .region{ width: 100%; margin: 0; } } </style> <div id="page" class="site region"> <header id="masthead" class="site-header"> <div class="site-branding"> <?php the_custom_logo(); if(is_front_page() && is_home()): ?>

<?php bloginfo( 'name' ); ?>

<?php else : ?>

<?php bloginfo( 'name' ); ?>

<?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; ?>
</header> <div id="content" class="site-content">

នៅ​លើ​បន្ទាប់ 19 គឺ​ជា​ការដាក់តំណរភ្ជាប់​ទាញយក​ពុម្ព​អក្សរ​ខ្មែរ​មួ​យ​ចំនួន​ពី​ប្រព័ន្ធ Google Fonts មក​ប្រើ​ការ​។ ចំណែក​ឯ​នៅ​លើ​បន្ទាត់​លេខ 20 វិញ គឺ​ជា​ការដាក់​តំណរ​ភ្ជាប់​ទាញ​យក​កញ្ចប់​ jQuery មកប្រើការ​។

ហើយ​កូដ CSS ចាប់​ពី​បន្ទាត់​លេខ 27 ដល់ 61 គឺ​ជា​ការរចនា​ក្បាល​គេហទំព័រ អោយ​មាន​រូប​រាង​ដូច​រូប​ខាងលើ។

ចាប់ពីបន្ទាត់លេខ 62 ដល់ 67 គឺ​ជា​ការរចនា​ក្បាល​គេហទំព័រ​សំរាប់​ទូរស័ព្ទ​ដៃ​។

នៅ​លើបន្ទាត់លេខ 63 ការសរសេរ​ថា class="site region" គឺ​ជាការ​បន្ថែមថ្នាក់​ region មួយទៀត​អោយ​ធាតុ div ដែល​មាន​ថ្នាក់ជា site មួយ​រួច​ទៅ​ហើយ​៕