WordPress a me MySQL: He aha kāu ʻōlelo e helu ai?

Depositphotos 16207113 s

Aia kekahi mau kamaʻilio ʻana ma nā blog e pili ana i ka nui awelika o kahi pou WordPress. Ua hoʻokahe ʻia kekahi mau kukui e kau kaupaona ʻia nā ʻenekia Search i ka hopena o ka mea mua x helu o nā huapalapala, kahi x ʻike ʻole ʻia i kēia manawa. ʻO ka hopena, he mea makehewa wale nā ​​mea ma hope o kēlā.

huaʻōlelo

Paʻi kiʻi mai ʻO Wordle!

Maikaʻi wau me kaʻu mau pou blog no laila e hana hou ana wau i kahi kānana a ʻike inā pili ka pilina o ka pou mai nā hopena ʻimi i ka 'ōlelo helu. ʻAʻole wau e ʻepekema loa, akā makemake wau e nānā hohonu.

Pehea e hiki ai iaʻu ke nīnau iā WordPress no Word Count?

ʻAʻohe o MySQL helu hana huaʻōlelo i kūkulu ʻia no MySQL, akā e like me kēlā me kēia nīnau i pane ʻole ʻia, ua pane ʻia kekahi kanaka akamai ma ka blogosphere pehea e hoʻohana ai i MySQL e loaʻa ai kahi Word Count.

Eia ka nīnau helu a ka mea kākau i hoʻololi ʻia no kahi database WordPress.

SELECT ʻID`, `post_date`,` post_type`,
SUM (LENGTH (`post_content`) - LENGTH (REPLACE (` post_content`, '', '')) + 1) AS 'Wordcount'
MAI `wp_posts`
GROUP E ʻID`
HAVING `post_type` = 'pou' AND` post_status` = 'paʻi'
KAUOHA E `post_date` DESC
LIMIT 0, 100

ʻAʻole wau i kau inoa i kēia manawa i ka 'pou pou kūpono' mai ka mea e hāʻawi maoli i ke kaupaona me kahi ʻenekini huli ʻaʻole maʻalahi ka huaʻōlelo helu, akā ka helu o nā loulou i kēlā ʻike. Inā loaʻa iā ʻoe kahi leka uila he 2,000 e ʻumeʻume i ka nānā nui o ka loulou, a laila ʻo ka nui kūpono o kāu pou he 2,000 huaʻōlelo.

7 Comments

  1. 1
  2. 2
  3. 3

    Kākau wau a hiki i ka loaʻa ʻana o kaʻu manaʻo. Manaʻo wau he mea naʻaupō ka poʻe e kūʻai aku nei i ka ʻike me ka helu huaʻōlelo.

    • 4

      Casey - Ua ʻae loa wau iā ʻoe. Manaʻo wau aia nā manawa e hoʻohana ai i nā kiʻi a me nā helu pōkā e huki ai i ka poʻe e heluhelu i ka ʻike, akā kākau wau a hiki i koʻu manaʻo ua hana ʻia ka manaʻo…

    • 5

      Casey - Ua ʻae loa wau iā ʻoe. Manaʻo wau aia nā manawa e hoʻohana ai i nā kiʻi a me nā helu pōkā e huki ai i ka poʻe e heluhelu i ka ʻike, akā kākau wau a hiki i koʻu manaʻo ua hana ʻia ka manaʻo…

Pehea kou manaʻo?

Ke hoʻohana nei kēia pūnaewele i ka Akismet e ho'ēmi i ka spam. E aʻo pehea e hanaʻia ai kāuʻikeʻikepili.