Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP Search on modularity modules hits drops one result while "in_the_loop" #35

Closed
andersrehn opened this issue Mar 12, 2018 · 0 comments
Closed

Comments

@andersrehn
Copy link

Using the standard WP search where a modularity module contains hits, one of the search results will be lost when using the while(have_posts()): the_post() syntax.

Error is caused due to global $post; already containing the first search hit when the code enters while(have_posts()). Calling the_post() will result in WP fetching the second search result. If just one result is found the page renders as if no results were found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants