Custom roles can’t access to wp-admin

With help of following code you can make a custom user role access the control panel. Following code works on hooks admin_init or init add_action( ‘admin_init’, ‘my_custom_function’ ); function my_custom_function() { add_role( ‘new_role’, ‘New Role’ ); $role = get_role( ‘new_role’ ); $role->add_cap( ‘edit_posts’ ); $role->add_cap( ‘edit_pages’ ); $role->add_cap( ‘edit_others_posts’ ); $role->add_cap( ‘create_posts’ ); $role->add_cap( ‘manage_categories’ … Read more

Which HTTP headers to use for subdomain embedding?

I was able to figure out that because Lightsail uses a Bitnami deployment of WordPress, Bitnami overrides the .htaccess file. Instead you have to update the /opt/bitnami/apache2/conf/httpd.conf file by adding the following content: <IfModule headers_module> <IfVersion >= 2.4.7 > Header always setifempty X-Frame-Options ALLOW-FROM https://*.example.com </IfVersion> <IfVersion < 2.4.7 > Header always merge X-Frame-Options ALLOW-FROM … Read more

After login get “403 Forbidden”

A 403 error is usually caused by either a plugin, a corrupt .htaccess file (this isn’t the case since the installation is local) or wrong permission on crucial files. If you are running Linux, try to run this in your local shell: find . -type d -exec chmod 755 {} \; find . -type f … Read more