New answers tagged

1

If you don't want to use add_feed(), then you can use add_rewrite_rule(): add_action( 'init', function () { add_rewrite_rule( '^feed/(schedule|calendar)/?$', 'index.php?feed=$matches[1]', 'top' ); } ); add_action( 'do_feed_schedule', function () { header( 'Content-Type: text/plain' ); // dummy type just for testing ...


7

If you want to rewrite example.com/test123 (a standard WordPress Page) to example.com/test234 (another standard WordPress Page) without having to save the rewrite rules in the database, then one option is using the request filter hook: add_filter( 'request', function ( $query_vars ) { if ( isset( $query_vars['pagename'] ) ) { $slug = $query_vars[...


Top 50 recent answers are included