Estoy trabajando con IONIC y la API-REST de WordPress, logre mostrar el título, el contenido, pero no logro mostrar la imagen del posts, podrían ayudarme? les dejo el JSON.

Para obtener el título por ejemplo lo hago de esta forma
{{data.title.rendered}}

Esa parte del JSON en donde está el título y todo el resto no la pongo porque sino se mezcla mucho, lo importante comienza en “_embedded”, prove de farias formas pero no lo he conseguido

Gracias

"_embedded": {
  "author": [
    {
      "id": 1,
      "name": "mtello",
      "url": "",
      "description": "",
      "link": "http://www.ejemplo.com/wp/author/carlos/",
      "slug": "carlos",
      "avatar_urls": {
        "24": "http://0.gravatar.com/avatar/305f57a2c80e5125992c671be2fa5087?s=24&d=mm&r=g",
        "48": "http://0.gravatar.com/avatar/305f57a2c80e5125992c671be2fa5087?s=48&d=mm&r=g",
        "96": "http://0.gravatar.com/avatar/305f57a2c80e5125992c671be2fa5087?s=96&d=mm&r=g"
      },
      "_links": {
        "self": [
          {
            "href": "http://www.ejemplo.com/wp/wp-json/wp/v2/users/1"
          }
        ],
        "collection": [
          {
            "href": "http://www.ejemplo.com/wp/wp-json/wp/v2/users"
          }
        ]
      }
    }
  ],
  "wp:featuredmedia": [
    {
      "id": 10,
      "date": "2017-05-19T04:35:37",
      "slug": "digital-marketing-03",
      "type": "attachment",
      "link": "http://www.ejemplo.com/wp/tecnologia/tercera-entrada/attachment/digital-marketing-03/",
      "title": {
        "rendered": "img-03"
      },
      "author": 1,
      "caption": {
        "rendered": ""
      },
      "alt_text": "",
      "media_type": "image",
      "mime_type": "image/jpeg",
      "media_details": {
        "width": 1920,
        "height": 1080,
        "file": "2017/05/digital-marketing-03.jpg",
        "sizes": {
          "thumbnail": {
            "file": "digital-marketing-03-150x150.jpg",
            "width": 150,
            "height": 150,
            "mime_type": "image/jpeg",
            "source_url": "http://www.ejemplo.com/wp/wp-content/uploads/2017/05/digital-marketing-03-150x150.jpg"
          },
          "medium": {
            "file": "digital-marketing-03-300x169.jpg",
            "width": 300,
            "height": 169,
            "mime_type": "image/jpeg",
            "source_url": "http://www.ejemplo.com/wp/wp-content/uploads/2017/05/digital-marketing-03-300x169.jpg"
          },
          "medium_large": {
            "file": "digital-marketing-03-768x432.jpg",
            "width": 768,
            "height": 432,
            "mime_type": "image/jpeg",
            "source_url": "http://www.ejemplo.com/wp/wp-content/uploads/2017/05/digital-marketing-03-768x432.jpg"
          },
          "large": {
            "file": "digital-marketing-03-1024x576.jpg",
            "width": 1024,
            "height": 576,
            "mime_type": "image/jpeg",
            "source_url": "http://www.ejemplo.com/wp/wp-content/uploads/2017/05/digital-marketing-03-1024x576.jpg"
          },
          "post-thumbnail": {
            "file": "digital-marketing-03-825x510.jpg",
            "width": 825,
            "height": 510,
            "mime_type": "image/jpeg",
            "source_url": "http://www.ejemplo.com/wp/wp-content/uploads/2017/05/digital-marketing-03-825x510.jpg"
          },
          "full": {
            "file": "digital-marketing-03.jpg",
            "width": 1920,
            "height": 1080,
            "mime_type": "image/jpeg",
            "source_url": "http://www.ejemplo.com/wp/wp-content/uploads/2017/05/digital-marketing-03.jpg"
          }
        },

Read more here: IONIC API-REST WordPress


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: