0

If I visit a product page, for example: http://woocommerce-176860-513159.cloudwaysapps.com/product/ardbeg-grooves-limited-edition/

And look at the breadcrumbs, they show the wrong product. It turns out the product that the breadcrumbs show is the last updated product in my backend…

How do I get my breadcrumbs working again and showing the current product that I am visiting?

closed as off-topic by Krzysiek Dróżdż, Jacob Peattie, cjbj, Andy Macaulay-Brook, kaiser Jul 5 '18 at 18:51

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?" – Krzysiek Dróżdż, Jacob Peattie, cjbj, Andy Macaulay-Brook, kaiser
If this question can be reworded to fit the rules in the help center, please edit the question.

0

The problem was a custom plugin I made was globally looping through some proucts with a WP_Query. This meant that the breadcrumbs were being set to the last product in that loop, not the product on that page... the solution was to reset the query in my plugin using wp_reset_query();. Always reset your queries!

Not the answer you're looking for? Browse other questions tagged or ask your own question.