• Resolved bmozes

    (@bmozes)


    Hello,
    I’m using the custom post type to store lecturers in my department in the university.
    I would like to open the post within the current folder I’m in, for example:
    My domain is: law.haifa.ac.il
    There is 1 sub-unit (called “criminology”) in my faculty and a group of lecturers.
    I’m trying to reach the situation that If I locate a link for the CPT under law.haifa.ac.il/criminology it will be open in the same place, i.e. law law.haifa.ac.il/criminology/[POST].
    Now all the posts are opening in the root directory: law.haifa.ac.il/[POST].

    Is there any solution to my request?

    Thanks in advance,
    Benny.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Did you make “criminology” in the “page” post type, an then the rest in whatever custom post type you registered?

    Put more abstractly, are you trying to have $domain/$PageSlug/$PostTypePostSlug/ URLs? If yes, then WordPress doesn’t, or doesn’t necessarily easily allow for content type URL mashups like that. If you were to do $domain/$ParentPostTypeSlug/$ChildPostTypePostSlug/ then that should be straightforward to achieve via a hierarchical post type and setting one post to be the child of another.

    Also, at least based on your examples, you’re seeing permalinks of $domain/$PostTypePostSlug when normally the post type slug is included, say if I had a post type of movie, then https://mydomain.com/movie/clue/

    Thread Starter bmozes

    (@bmozes)

    I see… I thought about the first option you wrote ($domain/$PageSlug/$PostTypePostSlug/) – the one that is not allowed by wordpress.
    Thanks anyway for your quick reply and detailed answer.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Tends to be best to keep content types together when it comes to the permalinks.

    @tw2113 I have the same question but instead of Pages and Posts, it’s about 2 Custom Post types.

    Let’s say that I have as CPT:
    – Author
    – Book

    I would need $domain/$ParentAuthorTypeSlug/$ChildBookTypePostSlug
    Exemple:
    $domain/william_shakespeare/hamlet

    My current challenge folds into 2 parts:
    1. How to set the “william_shakespeare” Author type post as the parent of the “hamlet” Book type post
    2. How to change the url/slug to take this hierarchy into account.

    Thanks a lot!

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Basically the same answer as above. Without some decent amount of permalink rewrite rule hoop jumping, they don’t make it easy to mix content types in one permalink, due to how permalinks are used to determine what to query.

    I wonder what https://www.ads-software.com/plugins/permalink-manager/ or perhaps their pro version, could do here, but I don’t know their product intensely to be able to say definitively that they can handle this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hierarchical custom post type cannot have a parent PAGE’ is closed to new replies.