WordPress.org

Ready to get started?Download WordPress

Forums

How do I pass Query Variable to Custom Post Template Archive? (2 posts)

  1. docarzt
    Member
    Posted 1 year ago #

    Greetings. I am using /%postname%/ permalinks and want to be able to pass a variable to my custom post type archive. My goal is to have the archive receive a value which I use to sort the individual posts. My overall goal is essentially fake 'categories' by assigning the custom posts a meta value and sorting using the value I pass through the url.

    A more literal Example:

    example.com/vegetables/

    is the path to my custom post type archive. I want to be able to direct users to this path:

    example.com/vegetables/potatoes

    and in the template be able to pull "potatoes" from the query string.

    Any ideas?

  2. docarzt
    Member
    Posted 1 year ago #

    Hmmm... "they" told me you guys were good. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic