Permalink Structure for Multiple Post Type Archives by Taxonomy

Here is part of the code from one of my projects to setup a similar structure for permalinks (same base slug for both the post type and the taxonomy archives), please note the values of ‘has_archive’ and ‘rewrite’ parameters of both the post type and the taxonomy: add_action( ‘init’, ‘register_my_post_types’ ); function register_my_post_types() { register_post_type( … Read more

Removing Parent Page(s) from Permalink

a quick search shows another stackexchange topic on this, and it used this code to cleanup the permalink of parents/ancestors: function wpse_101072_flatten_hierarchies( $post_link, $post ) { if ( ‘page’ != $post->post_type ) return $post_link; $uri = ”; foreach ( $post->ancestors as $parent ) { $uri = get_post( $parent )->post_name . “https://wordpress.stackexchange.com/” . $uri; } return … Read more

Use category base slug in posts’ permalink

I may be missing some vital detail in the question but here’s what I did to make this work. Settings -> Permalinks Set the permalinks to… /somePrefix/%category%/%postname%/ This will give you the following permalinks… Blog Page – domain.com/somePrefix Category Page – domain.com/somePrefix/currCategory/ Single Page – domain.com/somePrefix/currCategory/singlePost/ If you install some kind of plugin like Yoast … Read more

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