မဂၤလာပါရွင့္။
ညီမကေတာ့ Spiceworks Myanmar မွာ Backend developer အေနနဲ႔ ဝင္ေရာက္လုပ္ကိုင္ေနတဲ့ မသဲစုလြင္ ျဖစ္ပါတယ္။ ညီမ ဒီေန႔ေျပာျပသြားမည့္ အေၾကာင္းအရာကေတာ့ WordPress Custom Theme တစ္ခုေဆာက္ဖို႔အတြက္လိုအပ္ေသာ အေျခခံလုပ္ေဆာင္ခ်က္မ်ားကို ေဝမွ်သြားမွာျဖစ္ပါတယ္ရွင့္။
ပထမဦးစြာ ညီမတို႔ ထည့္သြင္းမည့္ custom wordpress theme အတြက္ folder တစ္ခုကို ေဆာက္ပါမယ္။ ထို႔အတြက္ Figure (1) တြင္ ျပထားသည့္အတိုင္း wp-content > themes > custom theme ဆိုၿပီး folder တစ္ခုေဆာက္လိုက္ပါတယ္။
Figure (1) – Folder structure
ဆက္လက္ၿပီး custom theme ထဲတြင္ style.css, index.php ႏွင့္ screenshot.png တို႔ကို Figure (2) အတိုင္း ထည့္သြင္းပါမယ္။
Figure (2) – Create style.css, index.php and screenshot.png
Style.css ဆိုတာကေတာ့ WordPress theme တစ္ခုမွာ မရွိမျဖစ္လိုအပ္ေသာ css file ျဖစ္ၿပီး Figure (3) တြင္ ျပထားသည့္အတိုင္း theme name, author, author uri, version စသည့္အခ်က္မ်ားကို ထည့္သြင္းေရးထားႏိုင္ပါသည္။
Figure (3) – Style.css
Screenshot.png သည္ ညီမတို႔ custom theme ၏ preview ကို screenshot ႐ိုက္ၿပီး ထည့္သြင္းထားျခင္း ျဖစ္ပါသည္။
ေနာက္တဆင့္အေနနဲ႔ ညီမတို႔ custom theme ကို activate လုပ္ပါမယ္။ ထို႔ေနာက္ WordPress post မ်ားကို ထုတ္ဖို႔အတြက္ index.php တြင္ Figure (4) အတိုင္း coding ေရးပါမယ္။
Figure (4) – index.php
ထို႔ေနာက္ header ႏွင့္ footer ထည့္ရန္အတြက္ header.php ႏွင့္ footer.php file မ်ားကို ညီမတို႔ custom theme folder ထဲတြင္ ထပ္ထည့္ပါမယ္။
ညီမတို႔ custom theme တြင္ style မ်ားကိုထည့္သြင္းလိုပါက functions.php တြင္ Figure (5) အတိုင္း ထည့္သြင္းႏိုင္ပါသည္။
Figure (5) – Functions.php
အထက္ပါ အေၾကာင္းအရာမ်ားကေတာ့ wordpress theme တစ္ခုကို custom ေရးခ်င္တဲ့အခါမ်ိဳးမွာ လိုအပ္ေသာ အေျခခံအခ်က္အလက္အနည္းငယ္သာ ျဖစ္ပါတယ္။ အဆုံးထိ ဖတ္ရႈေပးခဲ့ေသာ စာဖတ္သူမ်ားအားလုံးကိုေက်းဇူးတင္ပါတယ္ရွင့္။