Create custom Perma link

Just go to Settings > Permalinks, select Custom Structure and enter the following: /blog/%postname%/ That will add /blog/ to the beginning of post names in their permalinks. This will not affect Pages.

How can i edit all posts slug in bulk keeping WP native redirect?

This is what worked for me: function remove_false_words($slug) { if(!is_page()) if (!is_admin()) return $slug; $keys_false = array(‘unwanted’,’word’); $slug = explode (‘-‘, $slug); $slug = array_diff($slug,$keys_false); return implode (‘-‘, $slug); } add_filter (‘sanitize_title’, ‘remove_false_words’); Then you can use wordpress dashboard to select all posts, bulk edit, Update. And the words will be removed from slugs with … Read more

How do I add /blog/ on my permalink without affecting the portfolio project types permalink?

You can use the “post_link” filter with a conditional to check the post type to modify the single posts. For example: add_filter( ‘post_link’, function($post_link, $id){ $post = get_post( $id ); if( is_object( $post ) && ‘post’ === $post->post_type ) { return home_url( ‘/blog/’ . $post->post_name ); } return $post_link; }, 10, 2 ); You would … Read more

WordPress Set A Static Page/Template For All Sub-Pages

Okay so I have resolved this by combining several different wordpress functionalities: Catches the template include conditionally add_filter( ‘template_include’, ‘…’ );, in my case based on a regex match of the expected URI pattern locate_template(‘example-template.php’) to then resolve my (essentially) static template A query within my example-template.php that externally retrieves the resource This must handle … Read more