I’m trying to create a lists of links in a fixed header to all of the posts on my website (which uses Aesop Story Engine/Story Front).
I’m doing this with a simple WP_Query. Grabbing the permalinks to all of my posts, outputting them via a new loop, then calling “wp_reset_postdata()” to reset the WordPress loop. It works perfectly everywhere except on the homepage, which is using Aesop Story Front.
The problem I’m having is that wp_reset_postdata() resets the loop back to the static front page (defined in the WP settings) rather than back to the story post which I’ve set using this plugin (so instead of showing the story post assigned to the front page, it shows the actual content of that static page).
If there’s any guidance you can give me to help me solve this that would be great.
I managed to solve my problem by re-writing my code a bit.
I replaced my WP_Query call with a “get_posts()” call. Then manually looping the returned array of posts with a “foreach” and outputting what I needed (ie. so I’m not altering the main WP loop or global $post variable at all)
So the way I got around it was just to avoid using wp_reset_postdata() altogether. More of a work-around than a fix, but it works for what I need!