Show special backend content for certain roles

Possible Reasons – current_user_can() function needs an input of a capability not user role, though it works sometime but we should not use user role as a input to this function. you’re passing the subscriber object to function which is a lowest possible role we can have on WordPress. That’s why !current_user_can(‘subscriber’) makes it unavailable … Read more

How to add only a (sub) capacity to an user role?

It’s stupid, but you can’t. (Not without editing core, anyway.) Right at the top of the nav-menus.php source code is an edit_theme_options check that’s not filterable. http://core.trac.wordpress.org/browser/tags/3.4.1/wp-admin/nav-menus.php If you’re not concerned about your editors trying anything too shady, you could simply hide the menu items using a plugin like Adminimize or Admin Menu Editor. Of … Read more

How can I show different content for different user-levels?

This thread at wordpress.org – http://wordpress.org/support/topic/content-shown-based-on-user-role – suggests using the ‘current_user_can’ function This thread – http://wordpress.org/support/topic/display-a-custom-image-only-if-user-role-is-contributor – suggests you can use it like ‘current_user_can(‘contributor’)’ for different roles. I haven’t tried it but it sounds like it should work.

Is it proper to build a site supporting blog visitors in WordPress?

Maybe you need to use the WordPress Network feature Documentation of interest: Don’t Use WordPress Multisite Multisite Rationale WordPress Multisite 101 WordPress Multisite 110 EDIT: Some features of WordPress Multisite based on my investigation: 1 Users can register a blog in your site and publish their pages. 2 Users can embed images, audios and videos … Read more

Posts in sidebar only by admin

You need to add an author parameter to the query that is creating $cust_loop. You didn’t post that part of your code but something like: $cust_loop = new WP_Query( ‘author=123’ ); Or: $cust_loop = new WP_Query( ‘author_name=rami’ ); Note: Both of those taken (almost) straight from the Codex paged for WP_Query.

Require Capability to View Woocommerce Product

My guess is that your problem is here: if (is_product_category(‘b2b’)) Taking a look at the Woocommerce Documention for Conditional Tags is_product_category() will return true on product category archives. Therefore, it will never be true on the single product page. What I think you need instead is has_term() which checks a post for a particular term. … Read more

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