Creating Custom user type just like custom post

Well, Roles are in many ways custom user types and you can add meta fields specific to roles. For example… function is_my_user_role($id = null) { global $profileuser; if (empty($profile) && !empty($id)) $profileuser = get_user_to_edit($id); return (in_array(‘myrole’,$profileuser->roles)) ? true : false; } function my_user_fields($profileuser) { if (!is_my_user_role()) return false; // HTML for the fields } add_action(‘show_user_profile’, … Read more

Is there any way to give all users access to one blog in a multisite network without using a plugin?

You could filter get_blogs_of_user and add this particular blog to the returned list. Pseudo-code, not tested: add_filter( ‘get_blogs_of_user’, ‘add_special_blog’, 10, 3 ); function add_special_blog( $blogs, $user_id, $all ) { $new_blog = get_blog_details( $special_blog_id ); $blogs[ $special_blog_id ] = (object) array( ‘userblog_id’ => $special_blog_id, ‘blogname’ => $new_blog->blogname, ‘domain’ => $new_blog->domain, ‘path’ => $new_blog->path, ‘site_id’ => $new_blog->site_id, … Read more

show count author post today

Basic logic behind what you want: Find out the actual date e.g. $date_now Get posts by author http://codex.wordpress.org/Function_Reference/get_posts_by_author_sql that have the same publish date as $date_now (you need to do a sql query for that). count the rows that were returned and echo the output.

How change menu for each user in plugin?

Create a menu for each type of user in Dashboard >> Appearence >> Menus >> create a new menu (eg http://example.com/wp-admin/nav-menus.php?action=edit&menu=0) Then add a function to your theme’s functions.php to switch the menus. Something like as follows: add_filter(‘wp_nav_menu_args’, ‘wp_nav_menu_args_filter’); function wp_nav_menu_args_filter($args = array()) { if (is_user_logged_in) { // Menu for Logged In Users $args[‘menu’] = … Read more

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