How to manage same slug posts suffix method?

Developers can use the following filter: /** * Filters the post slug before it is generated to be unique. * * Returning a non-null value will short-circuit the * unique slug generation, returning the passed value instead. * * @since 5.1.0 * * @param string|null $override_slug Short-circuit return value. * @param string $slug The desired … Read more

Slug is redirecting to 404

This was caused by the Redirection plugin. Apparently it is trying to help by setting up redirects when you change the slugs for pages/posts. You have to click on “Groups” at the top of the Redirection plugin settings and then choose “Modified posts” to see the redirection that was automatically created to point from the … Read more

Using a portfolio_category slug in wordpress URL

add ‘rewrite’ => array(‘slug’ => ‘portfolio-categories’), but be sure to remove (not sure why that’s there, it tries hides the slug yet tries to rename it to “products” at the same time?): ‘rewrite’ => array( ‘with_front’ => false, ‘slug’ => ‘products’ ), So it looks like this: function mysite_post_types() { register_post_type(‘portfolio’, array( ‘labels’ => array( … Read more

slug: should I use latin characters only?

I will agree with King Li. Furthermore there is a very old plugin you can download from my dropbox that is still functional and will be of great help to you. What it does is changing the greek slugs to latin characters (greeklish) automatically for all new posts/pages/custom posts . You will have to manually … Read more

Sanitize slug title

If you a look at the source you’ll see it’s because the sanitize_title filter fires after remove_accents() is called by sanitize_title(). It does however, pass the raw title as the second argument so you can perform any substitutions on the raw title, apply remove_accents() and return it: function wpsesanitize_title_extra( $title, $raw_title, $context ) { $new_title … Read more

Make slug as ID Number for custom post types

Here’s a way how to change the slug: add_action(‘wp_insert_post’, ‘change_slug’); function change_slug( $post_id ) { // Making sure this runs only when a ‘eduation’ post type is created $slug = ‘eduation’; if ( $slug != $_POST[‘post_type’] ) { return; } wp_update_post( array( ‘ID’ => $post_id, ‘post_name’ => $post_id // slug )); }

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