Add ReWrite from Old Pages to WordPress (remove .php)
It should work with this lines which simply remove the .php from files that end with .php: RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]
It should work with this lines which simply remove the .php from files that end with .php: RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]
So the problem was redirect_guess_404_permalink was detecting a 404 error and ‘guessed’ /members/blog to be /blog My hacky solution was to hook into the status error check (Stop WordPress from “guessing” redirects for nonexistent URLs) and if URL parts match then unset the guessed solution function blog_no_redirect_guess_404_permalink( $header ){ global $wp_query; if( is_404() ) { … Read more
Pagination appearing twice in URL after rewrite
Blog List Page 404 With Custom Post Type Rewriting to Blog Parent
Milo’s advice set Mansur Khan in the right direction: In your rewrite_rules_array filter you can look at $rules and see everything you’d need to duplicate. There are a lot of them- single posts, author archives, date archives, taxonomy archives, post formats, attachments, plus pagination and feeds for all of them. The updated, working code: add_filter( … Read more
I found where problem was – i can’t set other year. All i needed to do is to rename year parameter to something else – for example my_year.
You don’t need to create a folder. And create a file inside your theme with starting content of following one <?php /* Template Name: Mail Page */ // here your mail page content. ?> Now goto backend and pages-> Add New. Title your page and select a Template Mail Page. Now you can write your … Read more
You should just need to change the permalink of the page in the back end of WordPress. You may also need to add the short code [woocommerce_my_account] to the page content depending on your version of WooCommerce. This would however also change the account page from my-account to just account aswell.
Well this is silly but I figured it out. I removed the last / from the pattern and now it works as expected. Code is now… add_rewrite_rule(‘^coaching/apply’, ‘index.php?page_id=5156’, ‘top’); Seems weird to me that ^coaching/apply would work but not ^coaching/apply/ esp when entering example.com/coaching/apply/ as the url works.
Ok, so it might have been working all along, and I just hadn’t flushed the rewrites! function my_dept_listing_init() { //Easy flush if (isset($_GET[‘flush’])) { flush_rewrite_rules(); } //endpoint onto which queries are made add_rewrite_endpoint( ‘individuals’, EP_PAGES ); //This filter acts as a controller, inject into content add_filter(‘the_content’, ‘my_dept_listing_content_ctrl’); } add_action(‘init’, ‘my_dept_listing_init’); function my_dept_listing_content_ctrl($content) { global $post; … Read more