How can I get multisite primary blog (url or path) for current user?

Indeed, get_active_blog_for_user should work. $blog = get_active_blog_for_user( get_current_user_id() ); $blog_url = $blog->domain… /* or $blog->path, together with $blog->siteurl */ Alternatively: $blog_id = get_active_blog_for_user( get_current_user_id() )->blog_id; // note: changed “->userblog_id” to “->blog_id” in row above to make it work. switch_to_blog( $blog_id ); /* switch context */ $home_url = home_url(); restore_current_blog(); /* back */

How to set privilege to wordpress subscriber for private page

Without a plugin something like this should work //functions.php function get_user_role() { global $current_user; $user_roles = $current_user->roles; $user_role = array_shift($user_roles); return $user_role; } //page template $role = get_user_role(); if($role == “subscriber”){ //cool you can see this } else { //sorry not allowed } A BETTER way would be to use something like the Members Plugins … Read more

Restrict certain posts from being sent to the feed subscribers

Simple answer is yes you can. 🙂 First check out WordPress’s codex here on their RSS feeds. http://codex.wordpress.org/WordPress_Feeds Then what you can do is change the default head rss links that let browsers know that there is an RSS feed. In your theme find: <link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”https://wordpress.stackexchange.com/questions/70834/<?php bloginfo (“rss2_url’);?>” /> And replace … Read more

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