Articles of routing

Redirect sub-pages to parent without changing URL

I am rewriting a WordPress site and plan to turn part of it into an angular app. The site has a bunch of sub-pages of the form /recommendations/xxxxx, and need to maintain these URLs for SEO purposes. But I want all these routes to return the /recommendations parent page whie keeping the rest of the […]

Changing WordPress routing to load the same page for different URLs

I’m converting an existing website to a WordPress theme. One of the pages is a gallery that uses JS history.pushState to create unique URLs for loading certain images. E.g. page URL (non WP website): URL for a certain image: I would like to preserve this functionality in WordPress. However, when loading the URL […]

Changing the Organize Series Listing Pages

I’m using the Organize Series plugin on my WordPress site. This plugin adds a custom taxonomy type named “series” that allows you to group posts together. This plugin includes a custom listing page at URLs that look like the following[series-name-here]/ I’d like to customize the HTML produced by these pages — but I’m a […]

WordPress plugin url for form submit

I am creating a custom plugin that has dynamic forms and I wanted to ask on how I can create a dynamic form action url. Example is Contact Form 7, how did cf7 create the form action url without creating a new page or a file for submission? Please share any idea on how to […]

WP custom routing does not work

I am trying to get custom rounting on WP without any plugins. I have a bunch of links looks like this: I’ve created a page with slug = “userinfo” and added such code in function.php of theme: add_action(‘init’, function(){ add_rewrite_tag(‘%username%’, ‘([^&]+)’); add_rewrite_rule(‘^u/([^/]+)/?’, ‘index.php?pagename=userinfo&username=$matches[1]’, ‘top’); }, 10); This is not works (showing 404 wordpress page), […]

How best to create a variation of an archive template work?

I’m still quite new to WordPress – after a pointer or two. I’ve created a archive page for a custom post type of ‘property’. This is set-up, working from an admin point of view, and I have a listing/index page showing the content created using a template I’ve themed called ‘archive-property.php’. While this archive template […]

What php files handles routing?

Given an URL like the following for wordpress What php files in wordpress is handling the routing?

Custom post type as child of page

I am wondering if it’s possible to have a page, let’s say called ‘books’ with some listed books. Next to this normal page we create an custom post named ‘books’ were we collect our books. Nou I already have the url with the overview of all my books, I am wondering how I need […]

Where and when does WordPress invoke routes

One of my URLs for which I’m wanting to create a Category Archive is coming up with a 404 despite having matching routes and, supposedly, matching templates. I’m going through the core WordPress code (groan) and haven’t figured out where routes are invoked. It seems that the Categories are decided in query.php in the parse_query […]

display dynamic content based on url slug on custom page

i have a custom page named locations and i want the url to load like this: /locations/california /locations/nevada etc.. and upon each page load of the given url as above content is loaded based on it. So for example if California is loaded specific information to california would be loaded. How would I go about […]