• Resolved Ziqurrat

    (@ziqurrat)


    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

    $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

    (@alexgso)

    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(). 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

    (@ziqurrat)

    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

    (@alexgso)

    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.