Custom post rewrite
-
Hi. I have some problem with custom post rewriting:
function permlink() { global $wp_rewrite; $wp_rewrite->add_rewrite_tag("%faq%", '([^/]+)', "faq="); $wp_rewrite->add_permastruct('faq', 'faq/%category%/%faq%.html', false); $wp_rewrite->add_rewrite_tag("%contract%", '([^/]+)', "contract="); $wp_rewrite->add_permastruct('contract', 'contract/%category%/%contract%.html', false); $wp_rewrite->flush_rules(); } add_action('init', 'permlink');
I need to create links like %category%/%postname%.html for all post types (also for default post, page). Is it possible?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom post rewrite’ is closed to new replies.