WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type Variable URL rewrites based on Taxonomies (4 posts)

  1. Mitchell McDeere
    Member
    Posted 2 years ago #

    Referencing this post here:

    http://wordpress.org/support/topic/custom-post-type-rewrite-permalink-and-exclude-base

    It appears that there is not a way to acheive results like this :

    "%custom_post_type_name%"/%taxonomyname_attached_to_custom_post_type%/%maybe_taxonomy_2_name%/%postname%/

    I'll use the movie site as an example:
    http://popcritics.com/movies

    "movies" I'm assuming is the custom post type.

    whereas genres could be classified as a taxonomy.

    Would it be possible to assign the "movies" custom post type a permalink url of "%movies%"/%genre%/ or something of that nature, Where you can nest taxonomies into the permalink structure.

    The only other way I could envision doing this is creating the Custom Post Type "movies" as Hierarchical and at the top level of this post type creating genre's "Comedy, Horror, Action" , then creating additional "movie" post types underneath their relevant genre.

    Ultimately, I hope to be able to add my movies , making mandatory genre (taxonomy) selections from the Add Movie screen and having, the Permalink build according to what is selected.

  2. Mitchell McDeere
    Member
    Posted 2 years ago #

    http://localhost:8888/wordpress/newsroom/USA/2011/08/summertime

    I was able to modify the code in the blog link to create a %region% taxonomy,

    It updates correctly in the permalink field while Editing the post, However it rewrites to:

    http://localhost:8888/wordpress/newsroom/%region%/%year%/%monthnum%/summertime

    when trying to view post.
    This is a bit confusing to me.

    [Code moderated as per the Forum Rules. Please use the pastebin]

  3. Mitchell McDeere
    Member
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic