Limit a number of users returned from sorting users by latest posts function

function get_users_ordered_by_post_date($offs=0, $lim=10, $ord=’DESC’) { global $wpdb; if(!is_numeric($offs) || !is_numeric($lim) || !in_array(strtoupper($ord), array(‘ASC’,’DESC’))) return array(); $q = “SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_status=”publish” AND post_type=”post” ORDER BY post_date {$ord} LIMIT {$offs}, {$lim}”; $users = $wpdb->get_results($q, ARRAY_N); foreach($users as $i => $u) $users[$i] = get_userdata($users[$i][0]); return $users; } ARRAY_N sets the return typs as an … Read more

Move users and passwords from one wordpress site to another

I use the WP Clone plugin https://wordpress.org/plugins/wp-clone-by-wp-academy/#reviews to ‘clone’ an existing site to a new site. Quite easy to use: install on ‘old” site then backup; install on new site, restore from the backup url you get during the backup. Quite easy to use, and usually reliable. I’ve sometimes had to backup/restore a second time … Read more

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