Can you please share the url to the page where it’s not working as well as the specific link that is the modal link? Also, the slug of the page you’re trying to open in the modal?
I also receive this problem. It never loads. I also saw in another post that it needs to just be the slug, but when I input the slug doesn’t work. It just has a loading icon spinning in the middle of a blank white screen.
Thread Starter
rampau
(@rampau)
I think i figure it out!
The problem appeared to be that what i was trying to open is a custom post type, so the plugin could not load it. I found that changing “post” for “whatever-the-custom-post-type-name-is” in “wp-post-modal/public/class-wp-post-modal-public.php” line 168 solved it.
I’m not using the plugin anywhere else, so that solution works for me. Maybe if someone is using both post and custom-post-type, changing that line is probably not gonna work.
Hope that helps anyone!
Thank you!
@rampau: great! you can also add your CPTs to the array. No need to replace “post”.
@millersethc: one way to confirm you are using the correct slug is to test whether the API is returning the correct response. If you go to: http://example.com/wp-json/wp-post-modal/v1/any-post-type?slug=SLUG (replace the slug with your slug), you should be able to see the API response.
For example, you see the “post_content” response here which is the one that will be used in the Popup: https://wp-post-modal.allureprojects.com/wp-json/wp-post-modal/v1/any-post-type?slug=home
I was also using custom post type, so that’s the problem. However, thank you for showing me the link to test if the API was returning the correct response, that also was helpful. I’ll see if I can reconfigure it to work with my custom post type by checking if the custom post type exists and then if it does to work in the php file. Thank you again!
Seth
Seth, great! If you need any more help, please don’t hesitate to reach out through the contact form on my site: https://allurewebsolutions.com/contact