Custom Post Type Archive in Sub Folder

Unlike page templates, WordPress doesn’t look in subdirectories for post template pages. The base function used for locating such templates is locate_template() (see source), which looks in the root directory of your theme (and parent theme). (On the other hand get_page_templates() searches sub-directory). You can use template_include filter (which filters the absolute path to your … Read more

WordPress in sub directory wp-admin problem

I think you are missing some rules in your WP .htaccess file. I show mine below. Notice the rules for wp-admin, add them to your file: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /subcataloged/cliens-wp/ RewriteRule ^index\.php$ – [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond … Read more

Changing directory and/or URL structure

@kureikain’s answer looks great, and it probably works really well in a wide variety of circumstances. But for author URLs specifically, there’s a simpler way. Change the author_base, like so: global $wp_rewrite; $wp_rewrite->author_base = “people”; $wp_rewrite->flush_rules(); You should only need to run this once, perhaps on a plugin activation. Updating WordPress should not affect this … Read more

Multisite installation combining subdomains and subdirectories

If the subdomains are just for looks and don’t actually impact data. Then have all subdomains point to the same place, install the domain mapping plugin: http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/ That may help. Alternatively you could just setup manual aliases to the main domain and as long as they all point to the exact same spot and you … Read more

Retrieve the template directory URI via global or get_template_directory_uri() every time?

I would stay stick to the function. PHP caches functions for speed and efficiency. In some situations, using a function is faster then using a variable. There are other benefits too – imagine if you changed the name of your variable – you would have to go and update every piece of code where it’s … Read more

How to set custom upload directory per user after moving content directory

With credits to petermolnar via irc://freenode.net/wordpress I can answer my own question. The key is to set an upload-dir filter in the theme’s functions.php: function per_user_upload_dir( $original ){ // use the original array for initial setup $modified = $original; // set our own replacements if ( is_user_logged_in() ) { $current_user = wp_get_current_user(); $subdir = $current_user->user_login; … Read more

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