WordPress.org

Support

Support » Plugins and Hacks » Hacks » custom rewrite rules for custom post type

custom rewrite rules for custom post type

  • hi,
    i’m registering a custom post type and in the rewrite array try to do something like this:
    'rewrite' => array('slug' => "explore/resources/".$CATEGORY, 'with_front' => false),

    I want the rule to ‘dynamically’ get the posts’s category name somehow.. I also tried using %category% there but it doesn’t work either.

    I need the post’s url to represent the entire path/route to it.. any ideas on how to achieve this?

    thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • array('slug' => "explore/resources/%category%", 'with_front' => false),

    betzster: doesn’t work, tried it already.

    can someone please explain how this rewrite rule works with the permalinks settings in the dashboard/admin panel?

    Do they have to match or something? e.g. “/explore/resources/%category%/” must be defined in the custom permalink structure field?

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom rewrite rules for custom post type’ is closed to new replies.