WordPress: Customize CSS yog tus Tshaj Tawm Luam tawm Niaj hnub no

wordpress logo

Kuv tau xav tau ntxiv rau daim me me duab rau kuv cov posts ib pliag tam sim no. Kuv tau sau ob chav kawm rau hnub div thiab teeb tsa cov duab keeb kwm yav dhau los sib txawv los ntawm seb puas los yog tsis tshaj tawm uas tau sau hnub no. Tsaug rau Michael H hauv WordPress Support Forums, Kuv thaum kawg tau txais kuv cov lus qhia tseeb! Ntawm no yog qhov kuv tau ua. Kuv muaj keeb kwm yav dhau los tso rau div chav kawm hnub:


Txog div niaj hnub no, Kuv teeb duab tom qab sib txawv thov rau chav div div npe hu ua_date_today:


Tam sim no kuv tau txais cov teeb ntawd, Kuv xav sau ib co cai uas ntxiv rau "_today" yog tias tus ncej tau sau hnub no:

post_date_gmt); if($post_date==gmdate('Ymd')) { echo '_today'; } ?>">

Ntawm no yog li cas no ua haujlwm:

  1. Kuv muab qhov sib txawv hu ua $ post_date sib npaug rau hnub tim ntawm daim ntawv muaj teeb meem ua Ymd.
  2. Kuv sau ib tsab ntawv yog cov nqe lus uas txhais tau hais tias yog qhov sib txawv ntawm qhov sib npaug hnub no (muaj tus qauv ntawm Ymd thiab), Kuv ntxiv “_today”

Voila! Tam sim no kuv tau muaj daim ntawv qhia hnub daim duab uas qhia txog seb puas los yog tsis yog tshaj tawm tau sau hnub no! Kuv tsuas yog xav tau kho rau timezone thiab kuv yuav tau nws ua!