Compare custom field values

Instead of storing your values as “5 hours 13 minutes” instead store them as timestamps, e.g. 5:13 for 5h 13m This way you can use the date/time comparator operations to answer questions E.g. to get items under 5 hours and 30 minutes: $args = [ … ‘meta_query’ => [ [ ‘meta_key’ => ‘time’, ‘meta_value’ => … Read more

Custom User Registration Form not showing

Presuming you have your custom registration form set up to its own URL, such as /custom-register-page/ or something like it, then you can use the following code to change the register URL on the default WP login page: add_filter( ‘register_url’, ‘update_register_url’ ); function update_register_url( $url ) { if( is_admin() ) { return $url; } return … Read more

Display Author name PHP (Selfmade Plug-IN)

Your $my_post array contains ‘post_author’ => $user_ID, but $user_ID isn’t defined. According to WP codex, get_currentuserinfo is deprecated, and should be replaced with wp_get_current_user. But in this case you want the ID, so a better option would be get_current_user_id So if you replace this line: get_currentuserinfo(); With: $user_ID = get_current_user_id(); You should be in business.