• Resolved Creativemind18

    (@jobsgivers)


    Currently single company url is: example.com/company/some-address. I want to add a child hierarchy called (test-material) so that the url will be: example.com/company/test-material/some-address.

    Below is a more detailed explanation of what i am trying to achieve:

    I want each company listed to automatically have a child that will enable me display job test materials for that company which will be served from another custom template.

    For example, if a user list a company called ABC LIMITED, the single company page of course will be example.com/company/abc-limited. But i also want to automatically have another url called: example.com/company/test-material/abc-limited which will be served from another page template with my job test materials.

    Please how do i achieve this?

    Your response to solving problems here has been very awesome, i know you can also help me on this.

    I await your reply please.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Kader Ibrahim S

    (@ibndawood)

    Hello there,

    Thank you for trying out our plugin. URLs are handled by WordPress through Permalinks. Customising permalinks are outside of our plugin’s scope.

    However, I looked into your requirement and I do not think your requirement can be achieved through default WordPress permalinks options.

    Hope this helps. Let us know if you have any other questions or need further help.

    Thanks,
    Ibrahim

    Thread Starter Creativemind18

    (@jobsgivers)

    Ok, thanks for your response.

    But generally, i know that it is possible to have hierarchical in custom post type. So how do i enable hierarchical in company CPT to enable me have parent and child relationship. I will be OK with this, if you can assist me on this.

    I await your response.

    Thanks.

    Plugin Contributor Kader Ibrahim S

    (@ibndawood)

    Hello again,

    Yes, you can have custom post type as hierarchical. Please use this filter to override the company register post type.

    add_filter( 'register_post_type_company', 'mywebsite_set_company_hierarchical', 10 );
    
    function mywebsite_set_company_hierarchical( $args ) {
        $args['hierarchical'] = true;
        return $args;
    }

    The above code will set the company post type as hierarchical and it should be added in your child theme’s functions.php

    Hope this helps. Let us know if you have any other questions or need further help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do i add a child to company CPT that is served from another template’ is closed to new replies.