Skip to main content

Posts

sawsan WordPress Theme မပြောင်းခင် ပြုလုပ်သင့်သည့်အရာများ

WordPress ရဲ့ Theme ကို ပြောင်းလဲဖို့ဆိုတာ အလွန် လွအလုပ်တစ်ခု ဖြစ်ပါတယ်။ ကိုယ်ကြိုက်တဲ့ Theme ကို activate လုပ်လိုက်ရုံလေးတင်ပါပဲ။ ဒါပေမယ့်လို့လည်း ကိုယ့်ရဲ့ လက်ရှိ အသုံးပြုနေတဲ့ Theme ကို အခြား theme နဲ့ အစားမထိုးခင် တနည်းအားဖြင့် မပြောင်းလဲခင်မှာ အောက်ကအချက်တွေကို ပြုလုပ်ပေးသင့်ပါတယ်။ ၁။ လက်ရှိ Theme အတွက် မှတ်တမ်းပြုစုပေးပါ။ ကျွန်တော်တို့ အနေနဲ့ WP Theme ကို မပြောင်းခင်မှာ လက်ရှိ အသုံးပြုနေတဲ့ Theme နဲ့ ပတ်သက်ပြီး အကောင်းအဆိုး၊ အကြောင်းအကျိုးကို မှတ်တမ်း ပြုစုပေးသင့်ပါတယ်။ ဘာကြောင့်လဲ ဆိုတော့ WordPress အသုံးပြုသူတွေဟာ သူတို့ရဲ့ WP Blog မှာ ဖြစ်ပေါ်နေတဲ့ ပြဿနာတွေကို Web ပေါ်မှာ ရှာဖွေလေ့ ရှိကြပါတယ်။ အဲဒီလို ရှာဖွေကြတဲ့အခါ ကိုယ်သုံးဖူးတဲ့ theme အကြောင်းကို ရှာဖွေနေတဲ့ WP users တွေအတွက် အထောက်အကူ ရရှိစေနိုင်ရန် လက်ရှိ theme ကို မှတ်တမ်းပြုပြီး Web ပေါ်မှာ တင်ထားသင့်ခြင်း ဖြစ်ပါတယ်။ အဲဒီလို မှတ်တမ်းပြုတဲ့အခါမှာလည်း theme ထဲမှာ မိမိ ထပ်မံ ထည့်သွင်းထားတဲ့ code တွေ အကြောင်း၊ ဘာဖြစ်လို့ ထည့်သွင်းရခြင်း ဖြစ်ပါတယ် ဆိုတဲ့ အကြောင်းကိုပါ မှတ်တမ်းထဲ ထည့်သွင်း ရေးသားသင့်ပါတယ်။ ၂။ Widget-Ready Them

sawsan How to add next link & previous link for wordpress single post

wordpress single post မှာ next post link နဲ့ previous post link ကို ဖော်ပြပေးချင်တာနဲ့ အဲ့ဒီ function ပါပီးသား theme တစ်ခုဖြစ်တဲ့ zBench theme ထဲက single.php ဖိုင်ကို ဖတ်ကြည့်ဖြစ်တယ်.. ကျနော်လိုချင်တဲ့ function အတွက် ရေးထားတဲ့ php code ကိုတွေ့ပါတယ်.. ဒီလိုလေး ရေးထားပါတယ်.. <div id="nav-below"> <div><?php previous_post_link( '%link', '<span>&larr;</span> %title' ); ?></div> <div><?php next_post_link( '%link', '%title <span>&rarr;</span>' ); ?></div> </div> ဒီ php code လေးကို ကျနော်တို့ရဲ့ wordpress theme ထဲက single.php ထဲမှာထည့်ပေးရမှာပါ။ single.php ထဲက ဘယ်နေရာလဲဆိုတော့ post entry တစ်ခုရဲ့ အဆုံးနားလေးမှာ ထည့်ပေးရမှာ။ ကျနော် ပုံလေးနဲ့ ပြပေးမယ်.. ဒီလိုဗျာ.. ပုံမှာ အနီရောင်နဲ့ပြထားတာက အရင်ရှိပီးသား post entry အတွက်ရေးထားတဲ့ php code အပြာရောင်နဲ့ပြထားတာက အခု ကျနော်တို့ ထပ်ဖြည့်လိုက်တဲ့ php code ဒါဆို ရှင်းမယ်ထင်ပါတယ်... အခု next & pre

sawsan How to add post entry content in search results

ဒီလိုဗျာ ကျနော်တို့ wordpress theme တွေမှာ search ကနေ တစ်ခုခုကို ရှာလိုက်ရင် တစ်ချို့ theme တွေမှာ post title အနေနဲ့ပဲ ဖော်ပြပေးတယ်။ post entry အပြည့်အစုံနဲ့ မဖော်ပြပါဘူး။ အဲ့လို post entry အပြည့်အစုံဖော်ပြပေးဖို့ဆိုရင် search.php ထဲမှာ php code လေးတွေ နည်းနည်းရေးပေးရမယ်.. search.php ထဲမှာ <?php if ( have_posts() ) : ?> ဒီ php code လေးကို ရှာပြီး အဲ့ဒီ code အောက်မှာ

sawsan How to add random post for wordpress

မနေ့က zBench theme ထဲက php file တွေကို ဖတ်ကြည့်ရင်း. single post တွေရဲ့ အောက်နားမှာ random post လေးတွေထည့်သုံးထားတာသွားတွေ့တယ်။ ဒါနဲ့ ကျနော်လည်း ကျနော့ theme ရဲ့ single post တွေမှာ random post ကိုထည့်သုံးချင်တာနဲ့ random post အတွက်ရေးထားတဲ့ php code လေးတွေကို ဆွဲထုတ်လိုက်တယ်။ ဒီလိုလေး ရေးထားတာဗျ။ <h3><?php _e('Random Posts', ''); ?></h3> <ul><?php $rand_posts = get_posts('numberposts=5&orderby=rand'); foreach( $rand_posts as $post ) :?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul>

sawsan Html Map

ကျနော်ဆိုဒ်မှာ သုံးထားတဲ့ html map နဲ့ ပါတ်သက်လို့ ကျနော့ကို pm ကနေမေးထားတာ ၂ ယောက်လောက်တော့ရှိတယ်။ အခုတော့ အဲ့ဒါသုံးပုံလေးကို ရေးပေးလိုက်ပါပီ။ <usemap="#Follow" border="0" height="16" width="95"><map name="Follow" id="Follow"><area shape="rect" coords="0,0,16,16" href="http://feeds.sawsan.com/rss" target="_blank"> ဒီ ပထမဆုံးပုံအတွက် coords သက်မှတ်ပုံက ၁။ ပုံရဲ့ ဘယ်ဘက်ကနေ စပြီး mouse area ဘယ်လောက်ချန်မလဲလို့ ဆိုလိုတာ အစဦးဆုံးပုံရဲ့ ဘယ်ဘက်အစဖြစ်တဲ့အတွက် 0 က စလိုက်ပါတယ်၊ ၂။ ပုံရဲ့ အပေါ်ကနေ စပြီး mouse area ဘယ်လောက်ချန်မလဲလို့ ဆိုလိုတာ ပုံရဲ့ အပေါ်ပိုင်းမှာ ချန်သလောက် area ကို mouse ထောက်လို့ မရပါဘူး၊ ဒါကြောင့် top က ပုံတိုင်းမှာ 0 ပဲထားလိုက်ပါတယ်၊ ဒီနေရာမှာ ပုံတည်ဆောက်ပုံအပေါ် မူတည်ပြီး ပြောင်းလဲနိုင်ပါတယ်။ ပုံရဲ့ အပေါ်ပိုင်းမှာ ပုံအသားကနေ နေရာလွတ်ချန်ထားခဲ့မယ်ဆိုရင် ပုံအသားပေါ် ရောက်မှ မောက် arrow ပေါ်စေချင်တာဆိုရင် ဒီနေရာမှာ area ကို ပုံဖန်တီးစဉ်က အပေါ်ပိုင်းမှာ ချန်ခဲ့