Use the category name instead of category slug in permalinks

I did not test this, but this should do what you want. Put the following in your functions.php: add_filter(‘rewrite_rules_array’, ‘new_category_name_rewrite_rule’); function new_category_name_rewrite_rule($rules) { $new_rules = array(); $categories = get_categories(); foreach ($categories as $category) { $cat_name = preg_replace(‘#\s+#’, ‘-‘, $category->name); $new_rules[“https://wordpress.stackexchange.com/”.$category->slug.”https://wordpress.stackexchange.com/”] = “https://wordpress.stackexchange.com/”.urlencode($cat_name).”https://wordpress.stackexchange.com/”; } return $new_rules + $rules; }

Echo custom taxonomy slug

Here’s the correct syntax for what you’re trying to do, if there’s just the single value for the ‘series’ custom taxonomy slug that you’re trying to retrieve. You were passing the whole array to your echoed string. I made a new variable $series which pulls the first/only value in the $terms_slugs array. And simplified a … Read more

Suddenly new posts have the default permalink instead of the post name

Nothing just happens for “no apparent reason”. Some new condition has caused this. Most likely a new plugin or update of an existing plugin. It is possible for a plugin or theme doing something crazy like flushing rewrite rules on every load could wipeout the existing rules. See this ticket for more info: http://core.trac.wordpress.org/ticket/18450#comment:34 if … Read more

Slug Taken, Cant Find Which Page

The slug is the poorly named post_name column in the $wpdb->posts table. Drop this into your theme templates somewhere– header.php, for example– and you should see any posts with a matching slug: $q = new WP_Query( array( ‘post_type’ => ‘any’, ‘name’ => ‘hello-world’, ) ); var_dump($q->request); var_dump($q->posts); You can tweak the arguments for WP_Query if … Read more

Change Slug of a Custom Post Type

In the code you posted, the filter ctc_post_type_item_args gets applied to the $args array before it is passed into register_post_type(). Putting a function into your themes functions.php and hooking it to the filter should do the trick: function wpse_191003_ctc_post_type_item_args( $args ) { $args[‘rewrite’][‘slug’] = “your_new_slug”; return $args; } add_filter( ‘ctc_post_type_item_args’, ‘wpse_191003_ctc_post_type_item_args’ );

How to add current custom taxonomy slug to body class

You can follow similar approach with get_the_terms. Here is the function. function add_taxonomy_to_single( $classes ) { if ( is_single() ) { global $post; $my_terms = get_the_terms( $post->ID, ‘custom-taxonomy’ ); if ( $my_terms && ! is_wp_error( $my_terms ) ) { foreach ($my_terms as $term) { $classes[] = $term->slug; } } return $classes; } } add_filter( ‘body_class’, … Read more

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