this is a test insight to check if its working
s 100% correct now. Look closely:
categories=1(uncategorized) → returns “Test” ✓categories=3(paraplanning) → returns “Hello world!” ✓exclude=1(all articles) → returns “Test” (correctly excluding the sticky featured post) ✓
Every single fetch, every single time, returns the right post with a 200 status. WordPress and your data-fetching code are both completely fixed. The bug you’re seeing is now purely visual — the correct data is arriving in the browser, but it’s not rendering. That’s a Framer Motion animation state bug, not a caching bug.
The actual cause
This block:
tsx
<motion.div
variants={staggerContainer}
initial="hidden"
whileInView="visible"
viewport={{ once: true, margin: "-50px" }}
className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"
>
uses whileInView with once: true. On your very first page load, this grid container plays its entrance animation and Framer Motion internally marks it as “already animated, never check again.” Because React reuses this same component instance across category switches (it’s the same position in the tree, just re-rendered with new props), that internal flag never resets. New posts mounting into an already-“triggered” container can get stuck without playing their fade-in — effectively invisible.
The fix — one change in InsightsPageClient.tsx
Replace that block with:
tsx
<motion.div
key={`${activeCategory}-${activeSearch}-${currentPage}`}
variants={staggerContainer}
initial="hidden"
animate="visible"
className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"
>
Two changes:
whileInView+viewport→animate: removes the scroll-intersection dependency entirely. The grid now always animates in immediately on render, with zero chance of getting stuck in a “waiting to scroll into view” or “already fired” state.- Added a
key: forces React to fully unmount and remount the grid whenever the category, search, or page changes, guaranteeing a clean animation state every single time — no leftover internal Framer Motion refs from the previous filter.
No other lines in that file need to change — everything else (motion.article, pagination, empty state) stays exactly as-is.
This should fully resolve it. Try it and let me know if the posts now show up correctly on every category switch.

Leave a Reply