PriceXauto, Chicago
WorldVsPlastic, FL, Miami, USA
Bluemoon BPO Solutions PVT. LTD., India
Vardaam Web Solutions PVT. LTD., India
With below code you can add Administrator role from functions.php file if you have FTP access and don't have wp backend access.
//Add administrator role if you have FTP from functions.php file
function imihir_admin_account() {
$user = 'wordpressadminfunction';
$pass = 'Wordpressadminfunction@2021';
$email = 'wordpressadminfunction@imihir.com';
if (!username_exists($user) && !email_exists($email)) {
$user_id = wp_create_user($user, $pass, $email);
$user = new WP_User($user_id);
$user->set_role('administrator');
}
}
add_action('init', 'imihir_admin_account');
This is a wordpress different types of queries (First for Custom post type and second is for DB)
$slide_args = array(
"post_type" => "posttypename",
"posts_per_page" => -1,
);
$slide_count = 0;
$slide_query = new WP_Query($slide_args);
while ($slide_query->have_posts()):$slide_query->the_post();
// Your code goes here
endwhile;
// WordPress DB Query
global $wpdb;
$pricexauto_maincar_query = $wpdb->get_results("SELECT * FROM wp_usermeta WHERE `user_id` = '$userid_for_fetching_other_data' AND `meta_key` = 'peepso_user_field_285' GROUP BY user_id");
// Foreach this query for displaying results