nikksan
Forum Replies Created
-
Forum: Plugins
In reply to: [Polylang] Remove page slug from home url – static pageGreat!
Is there any way I can remove the language code from url for non-default languages?Works like a charm!
Thank you!Forum: Themes and Templates
In reply to: [WP-Forge] Execute code right after user logs inOfc you have to create this table first ??
Forum: Themes and Templates
In reply to: [WP-Forge] Execute code right after user logs inThanks anyways , I found the solution online.
Here is the final code , eventually you end up with a table containing all logged in users , with their locations based on gelocation by IP.function addUserLocation($login){ $user = get_user_by('login',$login); global $wpdb; $loc = json_decode( file_get_contents('https://ipinfo.io/'.$_SERVER['REMOTE_ADDR'].'/json') )->loc; $latitude = explode(',' , $loc)[0]; $longitude = explode(',' , $loc)[1]; $wpdb->insert( 'locations', array( 'user_id' => $user->ID , 'firstname' => $user->display_name , 'lastname' => $user->last_name, 'email' => $user->user_email, 'latitude' => $latitude , 'longitude' => $longitude ), array( '%d' , '%s' , '%s' , '%s' , '%s' , '%s' ) ); } function removeUserLocation(){ global $current_user; global $wpdb; $wpdb->delete( 'locations', array( 'user_id' => $current_user->data->ID ), array( '%d' ) ); } add_action( 'wp_login' , 'addUserLocation', 99 ); add_action( 'clear_auth_cookie', 'removeUserLocation' , 1);
Forum: Themes and Templates
In reply to: [WP-Forge] Instructors shortcode paginationYup , thats the plugin.
Forum: Themes and Templates
In reply to: [WP-Forge] Instructors shortcode paginationNo problem , I fixed it.
Steps:
1.Uncomment this from shortcode.php$settings[‘pagination’] = ($pagination==’yes’)? ‘enable’: ‘disable’;
2.Open instructor-item.php and replace
echo gdlr_lms_get_pagination($query->max_num_pages, $paged);
with:
$totalInstructors = count(get_users(array(‘role’ => ‘instructor’)));
$totalPageNumber = ceil($totalInstructors / $args[‘number’]);echo gdlr_lms_get_pagination($totalPageNumber, $paged);
//echo gdlr_lms_get_pagination($query->max_num_pages, $paged);Forum: Fixing WordPress
In reply to: Set featured image not workingAccording to the them the problem is on a database level and they cant resolve it either.I will restore some old backups and see if that would help.
Forum: Fixing WordPress
In reply to: Set featured image not workingNo Console Errors,I`m communicating with the server support.