Custom Post Type in Wordpres 3

ပြီးခဲ့တဲ့ အပတ်က project တစ်ခုမှာ Custom Post Type ကို အသုံးပြုလိုက်ရတယ်။ Custom Post Type နဲ့ အတူ Custom taxonomy ကို ပါ သုံးလိုက်ရတယ်။ ဘာလို့ သုံးရတာလဲ။ တကယ်တန်းတော့ Post တစ်ခုတည်းနဲ့ တင်ရပါတယ်။ WordPress 3 မတိုင်ခင်ကဆိုရင်တော့ Post နဲ့ တင်ဖြစ်ပါတယ်။ WordPress 3 မှာ Custom Post Type နဲ့ Custom taxonomy ပါလာလို့ စမ်းချင်တာကြောင့်လည်းပါတယ်။ Custom Post Type နဲ့ Custom Taxonomy မရှိခင်တုန်းက Post မှာတင် ရှုပ်နေတာပဲ။ Custom Field တွေကလည်း တော်တော်ရှုပ်တယ်။ Category တွေက အရမ်းများသွားတယ်။ ဥပမာ။။ Country နဲ့ Brand ဆိုပြီး category အောက်မှာ sub category ရှိတယ်ဗျာ။ အဲဒီတော့ User က Add New မှာ တင်တော်တော် လေးကို ရွေးရခက်တယ်။ Country Category ကိုလည်း check လုပ်ဖို့ လိုသလို Brand Category ထဲက တစ်ခုကိုလည်း check လုပ်ရပါတယ်။

ဒီတော့ ဘာဖြစ်လည်းဆိုတော့ သုံးရတာ မျက်စိရှုပ်တာပေါ့။ Custom Post Type နဲ့ Custom Taxonomy ပေါ်လာတဲ့ အခါမှာ Category တွေ များတဲ့ ပြဿနာကို ဖြေရှင်းပြီးသား ဖြစ်သွားတယ်။ ဥပမာ။။ Product တစ်ခုအတွက် Category က Country တွေ နဲ့ Brand Name တစ်ခုခုပေါ့။ သမာရိုးကျဆိုရင် Posts > Add New မှာ Category ထဲကနေ Country ရွေးရမယ် နောက်ပြီး Brand Name ကိုလည်း check လုပ်ခဲ့ရမှာပေါ့။ ပြီးရင် Custom Field အနေနဲ့ Price နဲ့ Address ကိုလည်း ရွေးပြီး ဖြည့်ပေးရမယ်။ add_meta_box ကို သုံးရင်လည်း ရပါတယ်။ သို့ပေမယ့် Product မဟုတ်တဲ့ Post တွေ အတွက် မျက်စိနောက်စရာပေါ့။

Custom Post Type ကြောင့် Products > Add New ဆိုပြီး သွားလို့ရပြီလေ။ နောက်ပြီး add_meta_box နဲ့ တွဲသုံးလိုက်တော့ Custom Filed ရွေးစရာမလိုတော့ဘူး။ အဲဒါအပြင် Category အစား Brand နဲ့ Country ဆိုပြီး Taxonomy သီးသန့်ပါလာတာပေါ့။ အဲဒီတော့ user ကလည်း ရှင်းသွားပြီ။ Product အသစ်ထည့်ချင်ရင် Products > Add New သွားပြီး ဖြည့်လိုက်ရုံပဲလေ။

အဲဒါကို ဘယ်လိုရေးရသလဲဆိုတာကတော့ ထွေထွေထူးထူး မရှာလိုက်ရဘူး။ net.Tutsplus.com မှာ အရန်သင့်ပါဗျာ။ အဲဒါလေးကို ဖတ်ပြီးလုပ်လိုက်တာပဲ။

7 Comments

  1. ကေထူး says:

    တော်တော်လေးအသုံးဝင်တဲ့ information မှာ။ ညွှန်းထားသလို စမ်းကြည့်လိုက်ပါမယ်။ ကျေးဇူးပါ။ နောက်လည်း ဒီလို ပို့စ်တွေကို တင်ပေးပါ။

  2. wlo says:

    sg မှာ php web developer အဖြစ်အလုပ်လုပ်ချင်လို့။ sg ကအသိအမှတ်ပြုပြီးမြန်မာနိုင်ငံမှာ ဖြေလို့ရတဲ့ php စာမေးပွဲလေးရှိရင်သိချင်ပါတယ်။

    1. saturngod says:

      php , no need exam =) just show your experience and projects.

      1. wlo says:

        projects ကဟိုရောက်မှလုပ်ရတာလား? အရမ်းခကိပါသလား? English လိုရောကျွမ်းကျင်ဖို့လိုပါသလား?

        1. saturngod says:

          I mean… what projects do you have to show ? What experience can you show ?

  3. wlo says:

    ဘယ်လို project မျိုးလောက်ဆိုရင် အလုပ်ရနိုင်ပါသလဲ?

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.