Clean WP 4.9.8 Installation
Plugins:
Co-Authors Plus Version 3.3.0
Post Views Counter Version 1.2.14
Query Monitor Version 3.1.1 (debugger)
Hello Support,
When i try to view posts by author and then to sort them (ASC/DESC) it returns no posts.
Query:
SELECT SQL_CALC_FOUND_ROWS wp_test_posts.*, SUM( IFNULL( pvc.count, 0 ) ) AS post_views
FROM wp_test_posts
LEFT JOIN wp_test_term_relationships AS tr1
ON (wp_test_posts.ID = tr1.object_id)
LEFT JOIN wp_test_term_taxonomy
ON ( tr1.term_taxonomy_id = wp_test_term_taxonomy.term_taxonomy_id )
LEFT JOIN wp_test_post_views pvc
ON pvc.id = wp_test_posts.ID
AND pvc.type = 4
WHERE 1=1
AND ( wp_test_posts.post_author IN (1)
OR (wp_test_term_taxonomy.taxonomy = ‘author’
AND wp_test_term_taxonomy.term_id = ‘4’))
AND wp_test_posts.post_type = ‘post’
AND (wp_test_posts.post_status = ‘publish’
OR wp_test_posts.post_status = ‘future’
OR wp_test_posts.post_status = ‘draft’
OR wp_test_posts.post_status = ‘pending’
OR wp_test_posts.post_status = ‘private’)
GROUP BY wp_test_posts.ID
HAVING MAX( IF ( wp_test_term_taxonomy.taxonomy = ‘author’, IF ( wp_test_term_taxonomy.term_id = ‘4’,2,1 ),0 ) ) <> 1
HAVING post_views > 0
ORDER BY post_views ASC, wp_test_posts.ID ASC
LIMIT 0, 10
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘HAVING post_views > 0 ORDER BY post_views ASC, wp_test_posts.ID ASC LIMIT 0, 10’ at line 1
Screen: https://ibb.co/cswUnA
Please help to fix that.