Remove Slug from Custom Post Type

There is a simpler and lighter solution: First: set the slug argument for your custom post type to “https://wordpress.stackexchange.com/” when registering the post type: add_action( ‘init’, ‘register_my_post_type’ ); function register_my_post_type() { $args = array( //The rest of arguments you are currently using goes here ‘rewrite’ => array( ‘slug’ => “https://wordpress.stackexchange.com/” ) ); register_post_type( ‘my-post-type’, $args … Read more

Handle category name URL rewrite before different post type slugs

After some brainstorming and a lot of trial and error with T5 Rewrite and HM Rewrite, I went for the simplest possible solution. The permalink was actually intercepted by WordPress so I didn’t need the additional rewrite rule (even though it didn’t hurt, other than performance). I left %category%/%post_id%/%postname% as the default custom permalink, and … Read more

Get post by page name or slug

Hi @Zach Shallbetter: If I understand your question, then you are looking to solve your problem using theming functions when you really need to use more of WordPress’ API. The following code can be copied to a test.php file and run using http://yoursite.com/test.php for you to see how it works (assuming you replace http://yoursite.com with … Read more

How to add dot(“.”) in post slug

WordPress runs slugs through its sanitize_title_with_dashes() filter function which replaces dots with dashes. Unfortunately the function doesn’t give you any control over that or any ability to change what characters are stripped or replaced. What we can do however is remove that filter and add our own version of it with a couple of modifications: … Read more

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