function add_before_and_after_rewrite() { add_rewrite_tag("%cat_id%", '([^/]*)'); /*add_rewrite_tag("%video_src%", '([^/]*)'); add_rewrite_tag("%video_title%", '([^/]*)');*/ // Before And After //add_rewrite_rule('services.html', 'index.php?category_name=services', 'top'); //add_rewrite_rule('services.html', 'index.php??cat=8', 'top'); $cur_cat_id = get_cat_ID( single_cat_title("",false) ); $category = &get_category($cur_cat_id); //$slug =$category->slug; add_rewrite_rule('uncategorized.html?$', 'index.php?cat=1', 'top'); } add_action( 'init', 'add_before_and_after_rewrite' );Enjoy Code! | Raghunath Blog
How to add .html in category url using hooks: WordPress
Hello Everyone,
If you want to add the .html in category page url without using any plugin then just add my code in your function file
https://www.wp-experts.in/blog/mycategory.html
It’s possibile to use this with pages?
Hi MikSco,
Please have a look on below link https://www.wp-experts.in/blog/2014/02/07/how-add-any-custom-text-as-suffix-or-prefix-in-post-url-wordpress/