WordPress CPT slug and page slug conflicts

As you don’t need the CPT archvie, the easiest way to use example.com/new-site to open a page, and example.com/new-site/post-slug to open single posts of “new-site” post type, is to declare has_archive => false when registering the CPT: add_action( ‘init’, ‘cyb_register_cpt’ ); function cyb_register_cpt() { $args = array( // ….. ‘has_archive’ => false ); register_post_type( ‘new-site’, … Read more

Issue redirecting ‘blog’ to ‘news’ in WordPress using .htaccess

OK, so here’s the solution that works for me… <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^blog/(.*) news/$1 [L,R=301] </IfModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Thanks again to @WebElaine for the input!

how to output tags that has specific value in slug

Maybe you should re-consider your tag structure, if you must search for sub-strings, to be able to use it. Otherwise you can try e.g. $terms = get_terms( [ ‘taxonomy’ => ‘post_tag’, ‘search’ => ‘-en’, ] ); that performs a wildcard (*) search for *-en* within the term’s name or term’s slug. Also note the support … Read more

Use /prefix/postname as a slug in post_name?

Well it turns out you can’t use a slash (“https://wordpress.stackexchange.com/”) in the slug but I found a solution from How to set permalink structure via functions.php, set the permalink structure in your theme’s functions.php file add_action( ‘init’, function() { global $wp_rewrite; $wp_rewrite->set_permalink_structure( ‘/episode/%postname%/’ ); } ); It will add /episode/ before the post slug

Disable WordPress Archive Conflict Check

If you read a little further down past that code you are thinking about commenting out, you will see that right before the function is finished it provides a hook for the result: return apply_filters( ‘wp_unique_post_slug’, $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ); This means you can override what it is doing to your slugs: … Read more

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