Hier gibt es verschiedene Inhalte zu Themen rund um Linux, Heimautomation (mit FHEM) oder z.B. auch Ausbildung der Ausbilder. mehr »
Die Anzahl der WordPress Kommentare stimmt nicht
Sollte die Anzahl der WordPress-Kommentare je Post – aus welchem Grund auch immer – nicht passen, könnt Ihr diese mit folgendem SQL wieder gerade biegen:
UPDATE db_name.wp_posts wpp
LEFT JOIN
(SELECT comment_post_id AS c_post_id, count(*) AS cnt
FROM db_name.wp_comments
WHERE comment_approved = 1 GROUP BY comment_post_id) wpc
ON wpp.id=wpc.c_post_id
SET wpp.comment_count=wpc.cnt
WHERE wpp.post_type IN ('post', 'page')
AND (wpp.comment_count!=wpc.cnt
OR (wpp.comment_count != 0 AND wpc.cnt IS NULL));
„db_name“ ist natürlich durch Euren Datenbanknamen zu erset Weiterlesen »

