Hide all pages except landing page

I’d go with a similar approach as @Buttered_Toast: Create a template for a specific page (see template hierarchy, especially single page) and set this one as the home page. This then is your “landing page”. Do not forget to remove all references to wp_head, wp_footer, etc. Add a condition into the header for all other … Read more

Why: sticky front page code, shows latest non-sticky on logged-in front page

If you want both logged in and non-logged in user to see the same thing then you only want ‘published’ post status, at least it doesn’t make sense to me to show ‘private’ posts to non-logged in users. Alter you query to include that condition. $most_recent_sticky_post = new WP_Query( array( ‘post_status’ => array( ‘publish’ ), … Read more

‘post’ only for editor and administrator

The registered capabilities (and the other features) for registered post types are not saved in the database, but in a global variable, $wp_post_types. Being a global variable, editing it is easy. However you’ll also need to manually remove the menu item, otherwise authors and contributors will be able to see it even if they cannot … Read more

Custom Roles for access to specific term(s)

First I have a question, what you want to give them access to. Editing posts that have a certain category or seeing it on the site? When it comes to Roles, as is the case usually the codex is a great place to start – http://codex.wordpress.org/Roles_and_Capabilities. Specifically http://codex.wordpress.org/Function_Reference/add_role.

remove wp admin menu by customer user role

You can use wp_get_current_user() function to get current logged in user’s role //Remove admin menu items if not admin function remove_admin_bar_links() { global $wp_admin_bar, $current_user; $user = wp_get_current_user(); if ( in_array( ‘author’, (array) $user->roles ) ) { $wp_admin_bar->remove_menu(‘updates’); // Remove the updates link $wp_admin_bar->remove_menu(‘comments’); // Remove the comments link $wp_admin_bar->remove_menu(‘new-content’); // Remove the content link … Read more

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