Difficulty with rewrite rules

What you’ve done is add a query variable, that’s great and necessary for what you’re trying to do, but there are 2 more steps to take: Making it pretty: Add a rewrite rule to map /books/edition/xxx to index.php?ed=xxx Making it functional: Make it load your custom template so it knows what to do when the … Read more

Flush Rewrite Rules on init or rest_api_init?

Flushing rewrite rule should not be done on routine basis, as stated per codex: Don’t do it on any hook that will triggered on a routine basis. You should either do it via the plugin activation hooks, or the theme switch hooks: add_action( ‘after_switch_theme’, ‘wpse315001_flush_rewrite_rules’ ); register_deactivation_hook( __FILE__, ‘wpse315001_flush_rewrite_rules’ ); register_activation_hook( __FILE__, ‘wpse315001_flush_rewrite_rules’ ); function … Read more

Custom rewrite rule sends 404 header on multisite

Basically, you are doing one thing wrong, which is actually having a file named manifest.json inside /wp-content/themes/your-theme. So, first, delete your file /wp-content/themes/your-theme/manifest.json. Then, in your functions.php file you can have your rewrite rule as: function fvpd_pwa_rewrite_rules() { add_rewrite_endpoint( “manifest”, EP_NONE ); add_rewrite_rule( substr( parse_url( get_template_directory_uri(), PHP_URL_PATH ), 1 ) . “/manifest.json/?$”, “index.php?manifest=true”, “top” ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)