Make a single page in WordPress available only for Admin and Subscribers

please try this if ( have_posts() ) : while ( have_posts() ) : the_post(); if ( get_post_status (get_the_id()) == ‘private’ ) { if ( current_user_can( ‘administrator’ ) ) { the_title(); the_content(); } else if ( current_user_can( ‘subscriber’ ) ) { the_title(); the_content(); } else { echo ‘this post is private’; } } else { the_title(); … Read more

How to make an edit to an already published post back to Draft

Add below code in your current theme’s functions.php file. You have to replace USER ROLE with your user role name in if condition. function check_edit_post($post_id){ global $post; if( in_array(‘USER ROLE’, wp_get_current_user()->roles) && ‘product’ == get_post_type($post_id) && ‘publish’ == get_post_status($post_id) && $post->post_date != $post->post_modified ){ wp_update_post(array( ‘ID’ => $post_id, ‘post_status’ => ‘draft’ )); } } add_action( … Read more

WordPress not generating .htaccess but tells me that (Permalink structure updated.)

Try adding the following to a manually generated .htaccess file # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Without knowing more about the version of WordPress used & the setup of your web-server that’s the ebst … Read more

WordPress permissions error with admin account

How can I get around this? Talk to the administrator. If you’re supposed to have access to complete updates and you can’t do your job, he’s doing something incorrectly – don’t compound the problem by trying to find a backdoor into the file system when you should be welcome at the front door.

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