• Resolved nate22

    (@nate22)


    Here’s what I’ve done:

    Created the Testimonials Pod:

    1. I created a Testimonials pod and enabled REST API and checked read-only.
    2. I enabled Featured Image from the Advanced settings panel
    3. I saved the pod and double-checked these options were saved

    Created the Testimonials

    1. I made 3 testimonials, each with a Featured Image.
    2. I access the testimonials via /wp-json/wp/v2/testimonials
    • While this shows a nice JSON view of my Testimonials, only the very last post in the testimonials has a Featured Image href that actually works and that looks like this: "wp:attachment": [{href: https://localhost:888/wp-json/wp/v2/media?parent=63}]
    • The other 2 return empty arrays instead of a Featured Image JSON object.
    • When I view the one href that actually returns a JSON object, it has ALL the Featured Images for all three testimonials. I have no idea why that would be. Here is what that looks like: https://pastebin.com/Qtjqgsi3
    • This isn’t a template issue because I am just in JSON at this point. I do have Featured Images enabled in my functions.php file and they do show up when I view the pages through the browser.
    • Here is how Featured Images are enabled in functions.php:

      function mytheme_post_thumbnails() {
          add_theme_support( 'post-thumbnails' );
          add_post_type_support( 'page', 'excerpt' );
      }
      add_action( 'after_setup_theme' , 'mytheme_post_thumbnails' );
    • This topic was modified 6 years, 6 months ago by nate22.
    • This topic was modified 6 years, 6 months ago by nate22.
    • This topic was modified 6 years, 6 months ago by nate22.
    • This topic was modified 6 years, 6 months ago by nate22.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Jim True

    (@jimtrue)

    This is definitely a Bug Report, from our Support Policy linked at the top of the forums:

    If you’ve uncovered a Bug or have a Feature Request, we kindly request you to create an Issue on our GitHub Repository at https://github.com/pods-framework/pods/issues/new. Please be very specific about what steps you did to create the issue you’re having and include any screenshots or other configuration parameters to help us recreate or isolate the issue.

    We cannot work bug reports in the Forums as we often need to integrate your report into an actual bugfix and have you test the results. Marking this ticket closed in favor of your impending bug report.

    Thanks!

    Thread Starter nate22

    (@nate22)

    Okay, thank you.

    I’m going to do a fresh install of wp and simply make the pod first and ONLY work on this problem. Then, I’m going to do it on another computer running an even more recent version of MAMP. If it doesn’t start working, I’ll post a bug report.

    It seems like an issue with how WP API is accessing my paths.

    Thread Starter nate22

    (@nate22)

    It was not a Pods issue I finally discovered. If I could delete this whole thread, I would.

    Plugin Contributor Jim True

    (@jimtrue)

    No worries, at all. It happens ??

    So what was it?

    Thread Starter nate22

    (@nate22)

    It was adding an ?embed=true parameter for attachements.

    Still haven’t figured out how to correctly get the featured_image, but attachment will be okay for now. I “like” how they make a completely different format for two different kinds of images. Who ever valued consistency in code, anyway? Everybody? Oh yeah, that’s right. Everybody.

    Thread Starter nate22

    (@nate22)

    I’m sure the WP devs have reasons they needed to do things differently, btw. Probably something to do with legacy code, I guess.

    Plugin Contributor Jim True

    (@jimtrue)

    Possibly, but if this is part of the REST API, make sure it’s not Pods representing the output incorrectly or differently. (ie compare it against another post type). If it is us, open a bug report at https://github.com/pods-framework/pods/issues/new. Please be very specific about what steps you did to create the issue you’re having and include any screenshots or other configuration parameters to help us recreate or isolate the issue.

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Featured Images not showing up in JSON of pod’ is closed to new replies.