I'm recently added this code to my Wordpress website to add .html for my product category. It worked okay with the category (http://mywebsite.com/parent-category/product-category.html) but when I clicked the pagination, the link turned into (http://mywebsite.com/parent-category/product-category.html/page/2)
This is a code that i added to function.php on my site
function wpse_178112_category_permastruct_html( $taxonomy, $object_type, $args ) {
if ( $taxonomy === 'product_cat' )
add_permastruct( $taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%.html", $args['rewrite'] );
}
add_action( 'registered_taxonomy', 'wpse_178112_category_permastruct_html', 10, 3 );
Please help, I'm just a Wordpress newbie 😔.
Thank you!!!!!!!!!!
.html
to your URLs? Please update your question to provide some context as to the problem this solves, it may be thatadd_permastruct
is not what you need but it's difficult to tell with what you have ( it may also be that adding.html
to your URLs is unnecessary or even harmful )