Title: subloop-array Problem
Last modified: June 20, 2021

---

# subloop-array Problem

 *  Resolved [gafco](https://wordpress.org/support/users/gafco/)
 * (@gafco)
 * [5 years ago](https://wordpress.org/support/topic/subloop-array-problem/)
 * Hi,
    Im trying to use a subloop-array for data but having trouble. This is the
   JCON data:
 *     ```
       "current": {
               "last_updated_epoch": 1623959100,
               "last_updated": "2021-06-17 15:45",
               "temp_c": 27.8,
               "temp_f": 82.0,
               "is_day": 1,
               "condition": {
                   "text": "Partly cloudy",
                   "icon": "//weather/64x64/day/116.png",
                   "code": 1003
       }
       ```
   
 * Im using this subloop:
    {subloop-array:condition:-1} <p>Condition: {condition.
   text} {/subloop-array:condition}
 * The Condition is blank. Any ideas?
 * Thanks

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [5 years ago](https://wordpress.org/support/topic/subloop-array-problem/#post-14577495)
 * Hi,
 * you might try this:
 *     ```
       {subloop:current:-1}
       last_updated_epoch: {last_updated_epoch}<br>
       {subloop:current.condition:-1}
       <p>Condition: {current.condition.text}
       {/subloop:current.condition}
       current
       {/subloop:current}
       ```
   
 * Bernhard
 *  Thread Starter [gafco](https://wordpress.org/support/users/gafco/)
 * (@gafco)
 * [5 years ago](https://wordpress.org/support/topic/subloop-array-problem/#post-14583791)
 * No luck. This is what it returned:
    last_updated_epoch: 1624367700
 * Condition:
 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [5 years ago](https://wordpress.org/support/topic/subloop-array-problem/#post-14584295)
 * Hi,
 * try
 *     ```
       [jsoncontentimporter url=http://api.json-content-importer.com/extra/json/gafco.json]
       {subloop:current:-1}
       last_updated_epoch: {last_updated_epoch}<br>
       {subloop:current.condition:-1}Condition: {current.condition.text}{/subloop:current.condition}
       {/subloop:current}
       [/jsoncontentimporter]
       ```
   
 * This gives us [http://wptest.kux.de/gafco/](http://wptest.kux.de/gafco/)
 * Bernhard
 *  Thread Starter [gafco](https://wordpress.org/support/users/gafco/)
 * (@gafco)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/subloop-array-problem/#post-14593379)
 * when I put your code in the widget it did not work, but when I added it to a 
   custom HTML it seem to work. Can I not use the widget for to get this data?
 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/subloop-array-problem/#post-14598946)
 * Hi,
 * > when I put your code in the widget
 * What Do you mean by “widget”?
 * Using a Shortcode in a Widget like CustomHTML is the way it should work.
 * Bernhard
    -  This reply was modified 4 years, 12 months ago by [berkux](https://wordpress.org/support/users/berkux/).
 *  Thread Starter [gafco](https://wordpress.org/support/users/gafco/)
 * (@gafco)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/subloop-array-problem/#post-14676315)
 * Thanks

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘subloop-array Problem’ is closed to new replies.

 * ![](https://ps.w.org/json-content-importer/assets/icon-256x256.png?rev=3464653)
 * [Get Use APIs - JSON Content Importer](https://wordpress.org/plugins/json-content-importer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-content-importer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-content-importer/)
 * [Active Topics](https://wordpress.org/support/plugin/json-content-importer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-content-importer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-content-importer/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [gafco](https://wordpress.org/support/users/gafco/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/subloop-array-problem/#post-14676315)
 * Status: resolved