Title: Custom loop template
Last modified: October 16, 2017

---

# Custom loop template

 *  Resolved [Ziqurrat](https://wordpress.org/support/users/ziqurrat/)
 * (@ziqurrat)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/custom-loop-template/)
 * Hi, I’m using the Publish Loop widget to display events from a certain organizer
   inside a page.
    My WP theme doesn’t have a loop* template so I’m triying to write
   one on my own. I need help because I can’t access the query I’ve saved in the
   loop panel. Following the [documentation ](https://siteorigin.com/docs/widgets-bundle/form-building/post-selector/)
 * $processed_query = siteorigin_widget_post_selector_process_query( $instance[‘
   some_posts’ );
 * returns [post_status] => publish [posts_per_page] => 10 [post__not_in] => Array([
   0] => 1041 ) WRONG
 * The query I saved is like this
    post_type=tribe_events&tax_query=tribe_events_cat:
   corsi&date_type=specific&date_query={“after”:””,”before”:””}&date_query_relative
   ={“from”:[],”to”:[]}&orderby=date&order=DESC&additional=organizer%3D1041
 * How can I get to use that?
 * Thanks
    Ziqurrat

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

 *  Plugin Contributor [alexgso](https://wordpress.org/support/users/alexgso/)
 * (@alexgso)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/custom-loop-template/#post-9591619)
 * Hi Ziqurrat,
 * So the linked documentation is for form fields used within the SiteOrigin Widgets
   Bundle developer framework so it doesn’t apply to Post Loop Templates.
 * In this instance, I would use [get_query_var()](https://developer.wordpress.org/reference/functions/get_query_var/).
   For example, if I wanted to check the value of organizer I would use:
 *     ```
       <?php
       get_query_var( 'organizer' );
       ?>
       ```
   
 * Does that make sense?
 *  Thread Starter [Ziqurrat](https://wordpress.org/support/users/ziqurrat/)
 * (@ziqurrat)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/custom-loop-template/#post-9594016)
 * Hi alexgso, thanks for your reply.
    I’ve managed to make it work but really I
   can’t say I understand how 🙂 My query is saved inside $wp_query so I have to
   use it like this
 *     ```
       $post_selector_pseudo_query =($wp_query->query_vars);
       $processed_query = siteorigin_widget_post_selector_process_query( $post_selector_pseudo_query );
       ```
   
 * Solved, thanks.
    Ziqu
 *  Plugin Contributor [alexgso](https://wordpress.org/support/users/alexgso/)
 * (@alexgso)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/custom-loop-template/#post-9594322)
 * Hi Ziqu,
 * Awesome. Glad you managed to figure it out mate. 🙂

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

The topic ‘Custom loop template’ is closed to new replies.

 * ![](https://ps.w.org/siteorigin-panels/assets/icon.svg?rev=2556869)
 * [Page Builder by SiteOrigin](https://wordpress.org/plugins/siteorigin-panels/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/siteorigin-panels/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/siteorigin-panels/)
 * [Active Topics](https://wordpress.org/support/plugin/siteorigin-panels/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/siteorigin-panels/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/siteorigin-panels/reviews/)

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 3 replies
 * 2 participants
 * Last reply from: [alexgso](https://wordpress.org/support/users/alexgso/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/custom-loop-template/#post-9594322)
 * Status: resolved