Post Terms As Class Name For Full Calendar Events

You are using get_single_term in a way that would require it to return a value… $term = get_single_term($post->ID, ‘course_locations’); … but you have written it in such a way that it echos a value. You should have… function get_single_term($post_id, $taxonomy) { $terms = wp_get_object_terms($post_id, $taxonomy); if(!is_wp_error($terms)) { return $terms[0]->name; } } I noticed a couple … Read more

Upcoming events

The problem seems to be the comparison. WordPress compares the post meta using SQL, so you have to use its syntax. Try setting: <?php $today = date(“Y-m-d H:i:s”); ?> Which will return something like 2017-12-1 12:12:12 In your post meta make sure to use the same syntax. You can set dates in various formats, this … Read more

Group the events post in month+year format?

$arg = array( ‘post_type’ => ‘events-promotion’, ‘posts_per_page’ => -1, ‘post_status’ => ‘publish’, ‘meta_key’=>’wpcf-event-date’, ‘meta_value’ => $curdate, ‘meta_compare’ => ‘>=’, ‘orderby’=>’meta_value’, ‘order’ => ‘DESC’, ); $the_query2 = new WP_Query( $arg ); $arr=array(); if ( $the_query2->have_posts() ) : while ( $the_query2->have_posts() ) : $the_query2->the_post(); $eveid2 = get_the_ID(); $evedate2 = get_post_meta($eveid2,’wpcf-event-date’,true); $evedt = date(‘d/m/Y’, $evedate2); $pdate = date_i18n( … Read more

Plugin: Events manager – Next and previous event

The function WordPress ultimately uses for this is get_adjacent_post(), which has filters that allow you to modify the query directly. You’d have to modify the JOIN, WHERE and ORDER BY clauses to join the post meta table and order by your custom field. Another option is the Ambrosite Next/Previous Post Link Plus plugin.

Event booking form for wordpress

That’s quite a specific criteria- there are numerous event management plug-ins out there with bookings built in, but none will provide exactly what you are after. In general they will all have some form of date-picker (usually jQuery datepicker) – that’s because in general people will want to manually select dates. My suggestion is to … Read more

Update user meta after one hour

Please read carefully about wp_schedule_single_event in Codex. As you can see, there is a third argument $args. You can schedule a singule WP_Cron event by modifying the function you use above and passing arguments as third parameter: <?php // Your basic hook schelduling… wp_schedule_single_event( time() + 30, ‘user_cron_event’, array( ‘user_id’ => $user_id, ‘oldmoney’ => $oldmoney, … Read more