WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Understandind Custom Post Type Rewrite (3 posts)

  1. leogermani
    Member
    Posted 4 years ago #

    I cant find a way to have my rewrite option for a custom post type to work properly. Ive seen dozen of blogs and forum posts talking about this but with no clear resolution.

    What I expect:

    When I register a custom post type withe 'rewrite' set to true (which is the default value), I have pretty permalinks for my custom post types.

    eg. If I register a custom post type called 'book', my permalink will look like mysite/book/post-slug

    What I get:

    In my Edit screem it looks right, the "view book" links exactly as I expected, but I get a 404 error no matter what..

    I have tried setting my permalink structure in many different ways with no luck.

    Can someone please clarify this? Am I expeting right?

    Leo,,

  2. MichaelH
    Member
    Posted 4 years ago #

    Took this link right out of my test system using the Day and name permalink structure:

    http://localhost/wp30/book/catcher-in-the-rye/

    Update your permalinks. Then edit and save the article. Then View Book (or view post). Note: I'm using Function_Reference/register_post_type examples.

  3. leogermani
    Member
    Posted 4 years ago #

    Ive found my problem,

    publicly_queriable must be set to true.

    I found that the documentation was misleading the understanding of the public and publicly_queriable paramater.

    Hi, I have made a change to the documentation of register_post_type function on the codex. the description of publicly_queriable was using 'front page' meaning 'front-end'. Also, Ive made a better explanation of the public argument.

Topic Closed

This topic has been closed to new replies.

About this Topic