Custom post type rewrite with categories and static pages
Custom post type rewrite with categories and static pages
Custom post type rewrite with categories and static pages
Rewrite URL for CPT to domain/post-name/post-id
I would stick to make the url https://example.com/life/life-article/?special=1 I would create a php function that: retrives all posts and stores them in a variable; make a loop to loop all the posts and check if they are “life” posts; inside the same loop, if they are “life” posts, change their slug to …whatever/?special=1; and then … Read more
Custom route and extract data from slashes and parameter
404 error rewrite permalinks
Looks like all I needed to do was put the template_include filter inside of the init action. Source: https://stackoverflow.com/a/50037707/5749974 add_action( ‘init’, function () { $product_base = ltrim( get_option( ‘woocommerce_permalinks’ )[ ‘product_base’ ], “https://wordpress.stackexchange.com/” ); add_rewrite_rule( “{$product_base}/([^/]+)/test”, ‘index.php?product=$matches[1]&test=1’, ‘top’ ); add_filter( ‘template_include’, function( $template ) { if ( get_query_var( ‘test’ ) ) { $template = get_stylesheet_directory() … Read more
multiple URLS for the same page
wordpress path generation from rewrite rule
rewrite based slug standar post wp
add_rewrite_rule to load different page, without changing URL in browser