Add WordPress users to a custom post type

You can use the ACF plugin for https://wordpress.org/plugins/advanced-custom-fields/. Steps need to do: Download and installed ACF plugin. Click on Custom Fields link at the left side menu Add custom field as: Select custom as and publish it: Now add this code in functions.php file as: function acf_load_color_field_choices( $field ) { // reset choices $field[‘choices’] = … Read more

restrict admin panel sections to users

Add the following, to functions.php of the current theme (child theme is preferred!): CSS solution: function no_email_changes_in_profile() { $screen = get_current_screen(); if (‘profile’ == $screen->base && !current_user_can(‘manage_options’)) { echo ‘<style> input#email { pointer-events: none; } </style>’; } } add_action(‘admin_head’, ‘no_email_changes_in_profile’); jQuery solution: function no_email_changes_in_profile() { $screen = get_current_screen(); if (‘profile’ == $screen->base && !current_user_can(‘manage_options’)) { … Read more

Display recent members

You should try using the get_users function. https://codex.wordpress.org/Function_Reference/get_users Example: get_users(‘orderby=meta_value&meta_key=user_registered’);

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