WordPress.org

Ready to get started?Download WordPress

Forums

wp_rewrite and custom post types (2 posts)

  1. dependent
    Member
    Posted 1 year ago #

    Hi,

    I am trying now for a couple days to solve the following Problem:

    I habe a custom post type called gallery. I need the URL
    http://example.com/gallery/FOOBAR
    to be parsed like
    http://example.com/gallery/?param=FOOBAR

    I think I have tried about every code snipped that I could find to solve this problem but nothing seems to work.
    If I flush all rewrites, none of my links work anymore (404)

    Is is even possible?

    I'll be happy about any answer.
    best regards

  2. Maor Chasen
    Member
    Posted 1 year ago #

    If you use the default permalinks (query string), you'll be able to feature URLs in this format

    http://example.com/?gallery=FOOBAR

    If that's still not good and you actually need the /gallery/ path, you'll probably be able to do this by adding a new, custom rewrite rule using add_rewrite_rule().

Topic Closed

This topic has been closed to new replies.

About this Topic