0

I have an issue that is occurring with a custom post type, the fields are created with ACF.

I created plugin , that has a function that uses WP_query to pull 1 post and display it in a Divi Module using a shortcode.

It works fine, displays everything correctly. However if you delete the post its displaying , then reload the page, the site layout breaks in that section.

I initally thought it may have something to do with resetting the query, and tried wp_post_reset , but nothing seems to work

Note, that if the post that was deleted is restored from the trash, then all is well again .

Here is a link to the code: https://gist.github.com/colbyalbo/8fb906f7c20a7bc2b035b2d7bcc36912

  • It's worth noting that this is implemented on the Front page (static page). – colbyalbo Mar 22 '18 at 16:25
0

Disregard. I had a DIV imbalance somewhere in there. Rebuilt it , adding one thing at a time, and cant reproduce the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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