Why does chrome keep downloading a file instead of running the site?

What I do On receipt of WordPress files and Db install in my localhost directory (I use EasyPHP Dev server) I then install Db and change wp-config.php to connect to local db etc. Then copy .htacces to htaccess.back Edit .htaccess to point at local dir structure (in this case find “~porterp6” and replace with “wordpress2” … Read more

Permalinks not working Apache + CentOS 7

For the next person, be sure to set AllowOverride All in the correct directory. In Damon’s case he set AllowOverride All in the /var/www/html directory, but his site is located in /var/www/example.com/public_html. I could be wrong, but the AllowOverride setting is specific to the directory. Damon should add the AllowOverride All setting to the /etc/httpd/sites-available/example.com.conf … Read more

CSS not loaded when omitting www. part of URL

This can happen for several reasons – in your case, it looks like you are using a caching plugin that only recognizes www links. I suspect if you turned off caching you would not have that problem, but then you’d lose the benefits of caching. It’s best practice (with or without caching) to add redirects … Read more

CPT Post Title Permalink: Replace “@” (or all special characters) with dash “-” instead of just removing

Just make sure your filter runs before the one that WordPress itself applies – add a priority of 9: add_filter( ‘sanitize_title’, function( $title ) { if ( FALSE !== strpos( $title, ‘@’ ) ) { $title = str_replace( ‘@’, ‘-‘, $title ); } return $title; }, 9 ); Usage: echo sanitize_title( ‘[email protected]’ ); Output: mytitle-example-org

Is there anything built into the WordPress core to enable me to get the relative path from the “permalink structure” option

Is there anything built into the WordPress core to enable me to get the relative path from the “permalink structure” option No, because it isn’t necessary, PHP provides this via parse_url. Using php -a we can launch an interactive PHP shell and test the code: php > echo parse_url( ‘http://example.com/iamapost/100’, PHP_URL_PATH ); /iamapost/100 php > … Read more

How to change Post ID during import

wp_insert_post() function in WP accepts special import_id field in arguments and will try to use that ID, rather than automatically generating new one. This is easy to use when writing import code yourself, but I have no idea how easy would it be to with that plugin. You could try suggesting this as a feature … Read more

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