Title: No luck with nested subloop or subloop-array
Last modified: August 22, 2016

---

# No luck with nested subloop or subloop-array

 *  Resolved [Grey Man](https://wordpress.org/support/users/christopher-greenhough/)
 * (@christopher-greenhough)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/no-luck-with-nested-subloop-or-subloop-array/)
 * I don’t like to ask for help until I’ve tried to resolve a problem myself, but
   I cannot seem to get nested loops to work. Maybe I’ve missed something obvious,
   but as I need to resolve this soon I’m hoping someone else can see it : )
 * Here’s the feed I’m working with:
    [http://www.smart-feeds.com/getfeeds.aspx?Param=event/live/open](http://www.smart-feeds.com/getfeeds.aspx?Param=event/live/open)
 * And one example of where I’m at with the shortcode in WordPress:
 *     ```
       [jsoncontentimporter url="http://www.smart-feeds.com/getfeeds.aspx?Param=event/live/open" numberofdisplayeditems="-1" urlgettimeout="10" oneofthesewordsmustbein="Football" oneofthesewordsmustbeindepth="2" basenode="liveEvents"]
       {subloop:event:1}
       <h3>{sport}</h3>
       <small>{group}</small>
       <h4>{name}</h4>
       {/subloop:event}
       [/jsoncontentimporter]
       ```
   
 * This is fine. However, I cannot, however hard I try, find a way to retrieve the[
   path] (array? ) information nested within each {event}.
 * Likewise, I’m able to access the first-level data within the parallel {liveEvent}
   which I need to match up with {event}. That’s fine. But again, the nested {matchClock}
   or {score} I’m drawing a blank on. My {subloop} or {subloop-array} code is printing
   out within the post for these, so something is not right.
 * I must be making a syntax error or something, but I’m stumped.
 * Found this link useful for an easy way to see the data structure: [](http://jsonviewer.stack.hu)
 * Can you help?
 * [https://wordpress.org/plugins/json-content-importer/](https://wordpress.org/plugins/json-content-importer/)

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

 *  Thread Starter [Grey Man](https://wordpress.org/support/users/christopher-greenhough/)
 * (@christopher-greenhough)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/no-luck-with-nested-subloop-or-subloop-array/#post-5895648)
 * Weird, it didn’t keep the link I wanted to post. Let’s try again: [http://jsonviewer.stack.hu](http://jsonviewer.stack.hu)
 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/no-luck-with-nested-subloop-or-subloop-array/#post-5895722)
 * Hi Grey Man,
 * accessing [path], {matchClock} or {score} is possible, the template-code is a
   bit tricky.
 * But there’s one issue: If “0” is the value of the JSON, yet nothing is displayed.
   
   Here’s the deal: Donate what it’s worth for you, and I’ll fix this.
 * Best
    Bernhard
 *  Thread Starter [Grey Man](https://wordpress.org/support/users/christopher-greenhough/)
 * (@christopher-greenhough)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/no-luck-with-nested-subloop-or-subloop-array/#post-5895725)
 * Hahaha. I had a feeling you might say that. How about I donate $5 since that’s
   honestly all I have in my PayPal account. Next month I’m happy to donate more.
   Is that fair? : )
 *  Thread Starter [Grey Man](https://wordpress.org/support/users/christopher-greenhough/)
 * (@christopher-greenhough)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/no-luck-with-nested-subloop-or-subloop-array/#post-5895726)
 * Having trouble with the PayPal login so I’ve sent a payment to your email address(
   from Chris G). Thank you.
 *  Thread Starter [Grey Man](https://wordpress.org/support/users/christopher-greenhough/)
 * (@christopher-greenhough)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/no-luck-with-nested-subloop-or-subloop-array/#post-5895727)
 * Obviously it’s worth more than that. I apologize for the paltry sum.
 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/no-luck-with-nested-subloop-or-subloop-array/#post-5895733)
 * I’ll rembember you on 1st of april 😉
 * try:
    {subloop:event:1}<h3>{sport}</h3> <small>{group}</small><h4>{name}</h4>{
   subloop-array:event.path:3}{id} {englishName}{/subloop-array:event.path}liveData:{
   subloop:liveData:3}eventId: {eventId}time: {subloop:liveData.matchClock:3}{liveData.
   matchClock.period}{/subloop:liveData.matchClock} standing: {subloop:liveData.
   score:3}{home} {away}{/subloop:liveData.score} {/subloop:liveData}{/subloop:event}
 * “{home}” and “{away}” is “0” so this is not displayed and the described problem
   I’ll fix.
 *  Thread Starter [Grey Man](https://wordpress.org/support/users/christopher-greenhough/)
 * (@christopher-greenhough)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/no-luck-with-nested-subloop-or-subloop-array/#post-5895737)
 * Aha! Thank you so much, I’ll try that. I’ve been banging my head against it for
   hours. Didn’t realize I could use dot notation. Takes me back to my Flash ActionScript
   days. Truly appreciate your help. And I’m sorry for the meagre donation. If you
   don’t receive more next month, feel free to drop me a line with a gentle reminder!
 *  Thread Starter [Grey Man](https://wordpress.org/support/users/christopher-greenhough/)
 * (@christopher-greenhough)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/no-luck-with-nested-subloop-or-subloop-array/#post-5895811)
 * Thanks Bernhard. Perfect. For now I’ve solved the “0” issue by checking the blanks
   with jQuery and inserting text where required. A working solution. Next stop 
   would be, I guess, ajax updating the scores from the json feed.

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

The topic ‘No luck with nested subloop or subloop-array’ 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/)

 * 8 replies
 * 2 participants
 * Last reply from: [Grey Man](https://wordpress.org/support/users/christopher-greenhough/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/no-luck-with-nested-subloop-or-subloop-array/#post-5895811)
 * Status: resolved