I copied my site to another site but all links point to old site

What web addresses are in your Dashboard > Settings > general? if it is the old site, try changing it, if changing is impossible, try putting the following code at the top op wp-config.php: define(‘WP_HOME’,’http://www.new_site.com’); define(‘WP_SITEURL’,’http://www.new_site.com’); Are the site urls correct? Try searching your page template and see if you have still some old links … Read more

Changing permalink changes stylesheet path?

At a guess I’d say you’re linking to your stylesheet with a relative url like so: <link href=”https://wordpress.stackexchange.com/questions/6643/wp-content/themes/my-theme/style.css” rel=”stylesheet” /> so when you end up anywhere other than the home page it’s looking at the full URL plus the path indicated to your stylesheet. Make sure your stylesheet URL begins with a slash if you’re … Read more

Add .html to Woocommerce permalinks [closed]

This is the simplest way to add .html, which involves overriding the default permastructure: function wpse_178112_permastruct_html( $post_type, $args ) { if ( $post_type === ‘product’ ) add_permastruct( $post_type, “{$args->rewrite[‘slug’]}/%$post_type%.html”, $args->rewrite ); } add_action( ‘registered_post_type’, ‘wpse_178112_permastruct_html’, 10, 2 ); http://codex.wordpress.org/Function_Reference/add_permastruct For categories: function wpse_178112_category_permastruct_html( $taxonomy, $object_type, $args ) { if ( $taxonomy === ‘product_cat’ ) add_permastruct( … Read more

Filter string like a slug

You can use sanitize_title() function: $string = “This is title string”; // return “this-is-title-string” $slug = sanitize_title( $string ); You can also filter the result of sanitize_title() function using sanitize_title filter: add_filter( ‘sanitize_title’ , ‘sanitize_filter_callback’, 10, 3 ); function sanitize_filter_callback( $title, $raw_title, $context ) { // do something }

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