Events Made Easy Forums How do I … how to convert my widget code to work with events manger

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #42007
    Anonymous
    Inactive

    Here is the relevent snippet of code that I currently use for displaying custom post-type ‘events’ in my widget sidebar. I’ve tried to understand the events manager code base, but just plain don’t get it. Hoping you could lend a hand.

    <?
    // Place this function into your functions.php
    function generate_week_events($id, $date) {
    global $post;
    ?>
    <div id="tabs-<? echo $id; ?>">
    <?
    // This pulls all the posts in the events category that have a meta value that equals the date being fed into this function
    $args=array('cat'=> 9, 'meta_value'=> $date);
    query_posts($args);

    //This is ancillary to the function. only if you want the date: January 1st, 2010 in the description
    //$r_date = explode('/', $date);
    //$mk_date = mktime( 0,0,0, date($r_date[0]), date($r_date[1]), date($r_date[2]));
    // $print_date = date('F jS Y', $mk_date);

    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div>
    <strong><a href="<? the_permalink(); ?>"><? the_title(); ?></a></strong><br>
    <?
    $location = get_post_meta($post->ID, 'event location', true);
    if ($location!='') {
    echo "@" . $location;
    }
    ?>
    </div>
    <? endwhile; else: endif; ?>
    <? wp_reset_query(); ?>
    </div>
    <?
    }
    ?>

    The rest of the code is just my output, so it’s not really relevent. I can provide the entire code if needed, but prefer keeping it private for now.

    #44286
    Franky
    Keymaster

    Errr … what do you want to accomplish? From this code I can’t really deduce anything. You can always pm me if you want to take this private: liedekef [at] telenet.be

    #44287
    Franky
    Keymaster

    Errr … what do you want to accomplish? From this code I can’t really deduce anything. You can always pm me if you want to take this private: liedekef [at] telenet.be

    #44288
    Anonymous
    Inactive

    email sent.

    Basically I have a system ‘not events manager’ where I save my events in category 9. I have a custom field ‘event location’ as well.

    I’m simply looping through the posts in category 9, and separating them out to display according to their date.

    The rest of the code I emailed you will make everything much more clear.

    Basically I am simply trying to adapt this widget code that I use for use with events manager.

    I could find no documentation of how to use functions to manually call the events posts. I could only find the shortcodes, which does not help me out. I much prefer working with the actual functions.

    #44289
    Franky
    Keymaster

    I haven’t read the mail yet but if you want to use the functions: http://www.e-dynamics.be/wordpress/#displaying-events-and-locations (the template tags are in fact functions)

    #44290
    Anonymous
    Inactive

    Thank you for the functions reference page. I am quite used to working with the functions, but really have no clue how I am going to use my custom widget code with those functions. For the most part, I am just used to using custom wp_queries so this is rather new to me.

    I do love the events manager plugin though. It’s one of the only plugins that I install on almost every site I build. Glad to see someone taking over the plugin and making it better.

    #44291
    Anonymous
    Inactive

    I know it’s only been 3 days, but by any chance did you have a chance to look at my email code?

    I’ve been going through the events manager code as best I can, but cannot figure out how to merge the concepts together.

    #44292
    Franky
    Keymaster

    Well, for the moment I’m spending my time upgrading the google maps API used to version 3, but I’m fighting with some IE8 layout issues for the bubbles shown. If you’re interested: http://www.e-dynamics.be/wordpress/?p=54

    After that, you’re up 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top