How to give all CPT a folder automatically based on their slug

Your second function is wrong. get_post_type($post) excepts the current post object or post ID or any post object or ID given to it. You are using the arguments for get_post_types( $args, $output, $operator ) for get_post_type, which fails the function which in turn gives you the error in your foreach loop. To rectify your function, use something like this: … Read more

How to host unrelated pages on WordPress domain

Sure. Just add the subdirectory and then in your .htaccess file (in the base directory) add, before the index.php redirect lines another redirect something like <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^/otherdirectory/(.*) http://www.yourdomain.com/otherdirectory/$1 [L] </IfModule> Just make sure you dont have any url’s using otherdirectory in your wordpress installation.

Unable to update WordPress or install plugins/themes

I’ve seen this happen when WP doesn’t like the file owner. Can you change it to www-data and check file permissions? https://codex.wordpress.org/Changing_File_Permissions Or it could be that WordPress is getting confused by your /content folder, which is normally /wp-content. Have you defined WP_CONTENT_URL in wp-config.php? http://www.hongkiat.com/blog/renaming-wordpress-wp-content-folder/

Accessing an image folder inside public web directory

For directory (folder), only read is not enough. You need to set execute also. Because for directory, execute means you can enter the directory. Files need read permission & directory needs read & execute permission. So the directory permission should be: 0555. However, image files inside that directory should be just read, in numeric form: … Read more

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