get_post() with annoying limit 2,10

Posted in: Newspaper
Post count: 44

Hi
I am using NewspaperX theme. (functions.php unchanged. I totally removed my child theme directory from themes dir.)
I’ve noticed categories (page: /?cat=112 for instance) are showing no posts while instead there are one or 2 posts.
I activated query monitor plugin and I found the get_posts main query WP_Query->get_posts()
has a LIMIT 2,10 which I do not understand where it comes from.

By switching to theme twentytwenty the query correctly set and executed with LIMIT 0,10

Query with NewspaperX theme:


SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
FROM wp_posts
LEFT JOIN wp_term_relationships
ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1
AND ( wp_term_relationships.term_taxonomy_id IN (112) )
AND wp_posts.post_type = 'post'
AND (wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'active'
OR wp_posts.post_status = 'inactive'
OR wp_posts.post_status = 'expired'
OR wp_posts.post_status = 'private')
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC
LIMIT 2, 10

Query with Twentytwenty theme


SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
FROM wp_posts
LEFT JOIN wp_term_relationships
ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1
AND ( wp_term_relationships.term_taxonomy_id IN (112) )
AND wp_posts.post_type = 'post'
AND (wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'active'
OR wp_posts.post_status = 'inactive'
OR wp_posts.post_status = 'expired'
OR wp_posts.post_status = 'private')
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC
LIMIT 0, 10

it must be theme related (or plugin’s theme related).
This happens with every category.
So my question is
Is there anything I can check to see where that limit starting from record #2 is set?

Post count: 44

I disabled almost EVERY plugin

The ONLY Active plugins are:

  • Password Protected (by Ben Huson) (also disabled temporarily with no issue fix)
  • Query Monitor (by John Blackbourn)
  • tagDiv Composer
  • tagDiv Standard Pack

nothing else.

Post count: 18283

Hello !

Please contact us via email at contact@tagdiv.com and provide the following:

– admin url and credentials
– cPanel url and credentials
– A link to this topic in order to identify you

Our team will take a look !

Thank you !

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.