WordPress & PHP sessions

It is relatively simple. I’ve giving you a few steps. User visits your site and hit ‘Add to basket’ on an event. You need to send this data to server (as you wanted to store in php session). you can submit a form (for simplicity) either in synchronously or asynchronously (ajax). You need to submit … Read more

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

Identifying a Page Containing Shortcode at `init`

I’ve found an answer, although messy. /* // Plugin information goes here */ $GLOBALS[‘example_class’] = new example_class; class example_class { var $public_loaded = false, $content=””; public function admin_init() { add_menu_page( // … ); } // End of admin_init function public function get_random( ) { // … } } // End of example class add_action(‘init’, function() … Read more

Query Event Posts by Date

You need type casting for custom fields event-start-date and event-end-date. Then it will compare with time() & date() value. You need to add ‘type’ => ‘DATE’, in your meta query args. So your meta query will be like this: switch ($print_type) { case ‘current’: $meta_quer_args = array( ‘relation’ => ‘AND’, array( ‘key’ => ‘event-start-date’, ‘value’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)