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

WordPress Reserved Terms, any workaround?

No, the list of reserved terms is there for a reason: to make sure WordPress core features relying on URL’s work correctly, and to prevent conflicts with content or plugins.

Remove custom post slug and add category to custom post type

Use This… function chapter_post_type_init() { $labels = array( ‘name’ => ‘Chapters’, ‘singular_name’ => ‘Chapter’, ‘add_new’ => ‘Add New’, ‘add_new_item’ => ‘Add New Chapter’, ‘edit_item’ => ‘Edit Chapter’, ‘new_item’ => ‘New Chapter’, ‘all_items’ => ‘All Chapters’, ‘view_item’ => ‘View Chapter’, ‘search_items’ => ‘Search Chapters’, ‘not_found’ => ‘No chapters found’, ‘not_found_in_trash’ => ‘No chapters found in Trash’, … Read more

Change post slug but keep old one

This’ll probably have a few quirks, but in practice it’ll do what you’re after. Note that it’s set to only work for posts (not pages or custom post types). All we’re doing is using the wp_unique_post_slug filter, which runs after WordPress has generated it’s own unique slug, and additionally checking it against all _wp_old_slug meta … Read more

WordPress not adding -2 to slugs when saving post as draft

I just ran a quick test and there shouldn’t necessarily be a “slug” — post_name in the $wpdb->posts table– until the post is published, so something is going wrong with your site– something has been modified. WordPress already checks for duplicate slugs. This is pretty critical functionality as certain permalink structures depend upon it. The … Read more

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