Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #768664

    I have a query that gets all the post from custom taxonomy. I have modified the query that it only shows products that has a custom field value in_stock = “yes”

    I do this by adding meta_query to all the queries the site makes and it works well. The problem is that the pagination does not exclude those posts. At first it was not a problem but now that I have thousands of pages it starts to add up in the last pages. So the more posts are in the query, more empty pages are going to be in the end of pagination.

    For example if I have 50 posts / page and total of 50 pages -> there might be posts with in_stock value “yes” only for 48 pages and the rest are with the value “no” and they are not in the loop (and not showing like they should) but they seem to be counted in pagination.

    #769926

    Hey salesmusat,

    In this case you might need to implement custom pagination also. Here is a tutorial on that.

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #771603

    Hello!

    Thanks for the reply! I just took a look of the link you provided and found out that there was a use_main_query_pagination -> yes used in the attributes and it seemed to solve the problem to take that one line out :)

    #773105

    Hi salesmusat,

    Glad you got it working for you :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.