Title: Variable Access in Template Loop
Last modified: February 5, 2018

---

# Variable Access in Template Loop

 *  [amddtim](https://wordpress.org/support/users/amddtim/)
 * (@amddtim)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/variable-access-in-template-loop/)
 * I know that I can access several variables in my custom repeater template ([https://connekthq.com/plugins/ajax-load-more/docs/variables/](https://connekthq.com/plugins/ajax-load-more/docs/variables/)),
   but I’m wondering if I also have access to the full query that was just sent.
   Specifically, I’d like to access the custom_args I passed.

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

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/variable-access-in-template-loop/#post-9941374)
 * Hi [@amddtim](https://wordpress.org/support/users/amddtim/),
    You actually cannot
   access those in Repeater Templates.
 * The only way I have discovered is found here.
    [https://connekthq.com/plugins/ajax-load-more/docs/code-samples/passing-variables/](https://connekthq.com/plugins/ajax-load-more/docs/code-samples/passing-variables/)
 * Hope this helps.
 *  Thread Starter [amddtim](https://wordpress.org/support/users/amddtim/)
 * (@amddtim)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/variable-access-in-template-loop/#post-9941686)
 * Thanks, I saw this too. The sticky part is I need access to a variable that’s
   getting set with javascript, which is then filtering the alm instance. So I can’t
   set a session variable in the parent page template file and just be okay. If 
   I’m using sessions, I have to set a session variable each time a button is clicked
   that toggles the filter. Does that make sense?
 * How is it that you have 4 variables available in the repeater templates and no
   more? Couldn’t I conceivably edit the plugin to pass something else along? I 
   tried looking through the plugin files and couldn’t find where I might do that.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/variable-access-in-template-loop/#post-9943212)
 * The reason not all page variables are available is because Custom Repeater, Theme
   Repeaters and the Default Repeater all run through various filters/hooks and 
   by the time they are loaded the variables are no longer accessible.

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

The topic ‘Variable Access in Template Loop’ is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/variable-access-in-template-loop/#post-9943212)
 * Status: not resolved