Select event where start date is smaller than current date and end date is greater than current date

You can try to replace this kind of comparison: AND m1.meta_value >= ‘$start_date’ with: AND CAST(m1.meta_value AS DATE) >= ‘” . date( “Y-m-d H:i:s”, $start_date ) . “‘ or if you would use Unix timestamp for the meta values then you could try: AND m1.meta_value+0 >= “. strtotime( $start_date ) .” Update: Here is a … Read more

Post 2 Post: Getting connected ‘person’ from post author

On single post, try something like this: $author_id = get_the_author_meta(‘ID’); $people = get_posts( array( ‘connected_type’ => ‘people_to_user’, // replace with whatever ‘connected_items’ => $author_id, ‘suppress_filters’ => false, ‘nopaging’ => true ) ); Now $people[0] references the first (and only) author related to the post you’re on. So $people[0]->ID can be used to get the various … Read more

How to assign classes to all elements?

Jquery solution: **assuming your posts are in a division with the class of “post”. <script type=”text/javascript”> $(document).ready(function(){ $(“.post p”).each(function(){ $(this).addClass(‘paragraph’); }); $(“.post ul”).each(function(){ $(this).addClass(‘list’); }); //add more lines here to select more elements }); </script> Paste this in your footer. *you need jquery installed. And better yet would be to enque this using http://codex.wordpress.org/Function_Reference/wp_enqueue_script