WordPress Tips and Tricks
WordPress Text Editor မှာ နောက်ထပ် button များ ထည့်သွင်းခြင်း
Wordpress ရဲ့ မူလကပါတဲ့ text editor မှာ အောက်ကပုံမှာပါတဲ့ button တွေပဲ ပါပါတယ်။
ဒီ button တင်မကပဲ တစ်ခြားလိုအပ်တဲ့ button တွေရှိရင်လည်း ထပ်မံ ထည့်သွင်းနိုင်ပါတယ်။
ဒီလို ထည့်သွင်းဖို့အတွက် လက်ရှိအသုံးပြုနေတဲ့ themes ရဲ့ functions.php မှာ code အနည်းငယ် ရေးပေးရပါမယ်။
function add_more_buttons($buttons) {
$buttons[] = 'hr';
$buttons[] = 'sub';
$buttons[] = 'sup';
$buttons[] = 'fontselect';
$buttons[] = 'fontsizeselect';
$buttons[] = 'cleanup';
$buttons[] = 'styleselect';
return $buttons;
}
add_filter("mce_buttons_3", "add_more_buttons");
wordpress ရဲ့ add_filter ဆိုတဲ့ function ကိုအသုံးပြုပြီးတော့ ထပ်တိုးလိုက်တာပဲ ဖြစ်ပါတယ်။ ဒီလို ထည့်ပေးလိုက်တဲ့အတွက် ဘာတွေ ထူးခြားလာသလဲ ဆိုတာကို ဒီပုံကို ကြည့်လို်က်ရင် သိနိုင်ပါတယ်။
WP မှာသုံးထားတာက Tinymce Editor ပဲဖြစ်ပါတယ်။ ဒါကြောင့်မို့ Tinymce မှာ သုံးလို့ရတဲ့ button တွေကို ထပ်တိုးပေးလို့ ရပါတယ်။
Admin Panel ကို စိတ်ကြိုက် CSS Style ထည့်သွင်းခြင်း
Worddpress ရဲ့ admin panel ကို စိတ်ကြိုက် CSS Code တွေကို ထည့်သွင်းလိုရင်တော့ ဒီ code အနည်းငယ်ရေးပြီး လုပ်ဆောင်လို့ရပါတယ်။
function my_custom_css() {
echo '<style>
body, p {
font-family: "Lucida Grande";
font-size: 10px;
}
</style>';
}
add_action('admin_head', 'my_custom_css');
ဒီလိုရေးပေးလိုက်တဲ့ အခါမှာ wordpress admin panel ရဲ့ HTML head tag အတွင်းမှာ ဒီ style code ကို ထည့်ပေးလိုက်ပါတယ်။
Facebook comments:





နားမလည္ေပမယ္႔ ျပီးတဲ႔အထိ တစ္လံုးခ်င္း ဖတ္သြားတရ္