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 e kau inoa i kēia manawa i ka 'nui pou kūpono' mai ka mea maoli e hāʻawi 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 kuʻu manaʻo. Manaʻo wau he naʻaupō ka poʻe e kūʻai nei i ka ʻike i wahī ʻia me ka helu huaʻōlelo.

    • 4

      Casey - ʻAe like wau me ʻoe. Manaʻo wau aia he mau manawa kūpono e hoʻohana ai i nā kiʻi a me nā kiko pōkā e ʻumeʻume i nā poʻe e heluhelu ma o ka ʻike, akā kākau wau a hiki i koʻu manaʻo ua hana ʻia kēia kiko ... a hoʻāʻo wau e hana hou aku a i ʻole emi.

    • 5

      Casey - ʻAe like wau me ʻoe. Manaʻo wau aia he mau manawa kūpono e hoʻohana ai i nā kiʻi a me nā kiko pōkā e ʻumeʻume i nā poʻe e heluhelu ma o ka ʻike, akā kākau wau a hiki i koʻu manaʻo ua hana ʻia kēia kiko ... a hoʻāʻo wau e hana hou aku a i ʻole emi.

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.