Get Advanced Widget Variables in Theme Template

Home Forums Calendar Products Events Calendar PRO Get Advanced Widget Variables in Theme Template

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #46070
    UNC Web Services
    Participant

    Hey All,

    I am getting started with events calendar, so I’m sorry if this is a lame question. I am making a custom widget and I need to get all the variables that are mentioned in the top of the events-advanced-list-load-widget-display.php file. From the file:

    =============

    * When the template is loaded, the following vars are set: $start, $end, $venue, $address, $city, $state, $province’], $zip, $country, $phone, $cost
    * @return string
    */

    // Vars set:
    // ‘$event->AllDay’,
    // ‘$event->StartDate’,
    // ‘$event->EndDate’,
    // ‘$event->ShowMapLink’,
    // ‘$event->ShowMap’,
    // ‘$event->Cost’,
    // ‘$event->Phone’,

    ========

    How can I call these variables in another page template so I can use this on other pages?

    #46082
    UNC Web Services
    Participant

    Well, I think I’m half way there. It occurred to me I could use a standard query like this and then define the variables myself.
    ‘tribe_events’);
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) : setup_postdata($post); ?>

    The var_dump shows I have everything… all categories for now, but I could narrow that down I guess. 🙂 Just need to get assign the variables now.

    Unless there is an easier way… 🙂

    #46122
    Jonah
    Participant

    Hi Jeff,

    You do need to first run a query to return the records you are looking for and then you can access all the information for those records. get_posts() will do it but WP_Query is generally a better way: http://codex.wordpress.org/Class_Reference/WP_Query

    So, you’re pretty much doing it the way you should but you may want to use WP_Query instead.

    I hope that helps,
    Jonah

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Get Advanced Widget Variables in Theme Template’ is closed to new replies.