Create new URL structure for custom post types

Sorted in the end. As Milo suggested I didn’t need the calls to add_rewrite_tag. The following code works: /** * Custom rewrite rules */ function my_rewrite_rules() { add_rewrite_rule( ‘^([^/]*)/([^/]*)/([^/]*)?’, ‘index.php?post_type=room&room=$matches[3]’, ‘top’ ); add_rewrite_rule( ‘^([^/]*)/([^/]*)?’, ‘index.php?post_type=house_type&house_type=$matches[2]’, ‘top’ ); add_rewrite_rule( ‘^([^/]*)/?’, ‘index.php?post_type=development&development=$matches[1]’, ‘top’ ); } add_action( ‘init’, ‘my_rewrite_rules’ );

How to get a clean pagination link without variable

Sure you retrieve link like site.com/page/?cp=2, because you added get parameter cp. If you wanna link like site.com/page/cp/2 – remove base parameter and set format to ?cp=%#% If you wanna link like site.com/page/2 – remove ‘base’ and ‘format’ parameters and stay it default. Because format – is ?page=%#% by default.

permalink as content

Try to put this in functions.php of your theme. It’s untested in this form, but should work. /** * Change the Permalink on save / update */ function wpse_297006_rewrite_slug( $post_id, $post, $update ){ // check if it’s a post if (!(get_post_type( $post_id ) === ‘post’)) return; // check if it’s not a revision if (!(wp_is_post_revision( … Read more

Permalink Increments Not Updating/Removing

” so I have to go into the database “ Good. You know how to go to your database. Now what you can do is to check posts table for post_type page with slug drums, but not your one… some other, with different post_status (maybe trash, maybe draft). Once you remove duplicate from system you … Read more

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