Get slug of current category in functions.php

get_queried_object is how you retrieve the term for the current category, although you have to be careful to check for this, as it may not be a category archive. It could be a date archive, or a tag archive, etc etc At a minimum you should include an is_category check: https://developer.wordpress.org/reference/functions/is_category/ Reading the docs for … Read more

Message notification for user

You need to use wp_ajax action to callback your function. add_action( ‘wp_ajax_update_last_seen_value’, ‘update_last_seen_value’ ); function update_last_seen_value() { global $wpdb; $table=”ej_users”; $id = $_POST[‘id’]; $meta_value = date(‘Y-m-d H:i:s’); update_user_meta( $id , ‘last_seen’, $meta_value ); $data = array( “status” => ‘success’ ); echo json_encode($data); die(); } I have used your code and made correction to render scenario … Read more