I'm using PODS to create a custom post type called "automobile" on my site. This results in a permalink structure that looks like this:


I want to be able to send variables to this page by adding 1 OR 2 additional elements

/automobile/{brand is the default page}/%model%/%edition%/

For example


So the root automobile page would be the brand (porsche), which calls a PODS template. The PODS template executes code that allows the user to drill down. It's important for SEO reasons that the structure looks like this.

I've tried dozens of solutions, but as soon as I tack on anything beyond the page, I either get a 404 error or get redirected to the home page.

From everything I've researched, this should work added to functions.php:


function initialize_automobile_vars()


If I enter this, I am directed to the Porsche page:


But if I enter either of these, I get a 404 error:


I've tried almost everything, but haven't cracked the nut on this one. Any help would be appreciated!

1 Answer 1


Building Custom URLs in Wordpress discusses how to use Pretty Permalinks to display posts using additional parameters.

Jump to the section on Custom Query Vars. That's where your situation begins to be addressed directly.

In particular, you may want to use the example using 'pre_get_posts' to retrieve parameters and adjust the WP_Query using a meta_query, so it doesn't result in a 404 Error as a result of your additional parameters:

add_action( 'pre_get_posts', 'your_function_name', 1 );

NOTE: You may need to modify your customized url to read more like the following, in order to fit the example provided by this tutorial:


In this example, "model" and "name" are keys, while "911" and "carrera" are their respective values. These can then be used for meta_query searching.

  • Mike, thanks so much for this. I've been struggling with this for a while, and this is just the directional input I needed.
    – Bill
    Sep 5, 2019 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.