Tagged: portfolio item hierarchy
-
AuthorPosts
-
November 22, 2025 at 12:28 am #1491666
Hi,
I tried to allow portfolio hierarchy according to this topic to no avail. After adding the second piece of code to my child theme functions.php file, I can add the parent page, but I get a 404 error when I try to access it by clicking the page updated link. I can also see the child page under the parent page in the portfolio item list, but I get a 404 error when I try to access it from there too.
Best regards,
SergeNovember 24, 2025 at 7:03 am #1491713Hey photographie-tous-azimuts,
Thank you for the inquiry.
The parent page is displaying correctly on our end, but not the child page which seems to have an invalid URL or path (ingredients). How did you create the child portfolio item?
Please provide the login details in the private field so we can check the issue.
Best regards,
IsmaelNovember 24, 2025 at 4:24 pm #1491759Hi Ismael,
As mentioned on this topic, I did add the following code to the functions.php file of my child theme in order to enable hierarchy for portfolio items:
add_action('init', function() { function avf_portfolio_cpt_args_mod( $args ) { $args['hierarchical'] = true; $args['supports'][] = 'page-attributes'; return $args; } add_filter( 'avf_portfolio_cpt_args', 'avf_portfolio_cpt_args_mod' ); });Then, I used Page attributes of the child portfolio item to set its parent page. The URL of child pages displayed when I modify the page is:
https://www.cuisine-chinoise.org/recette/saute-aux-huit-tresors/ingredients/
but it acts as an invalid URL when used.The topic owner did mention a problem and sait he fixed it, but does not tell how he did.
Best regards,
SergeNovember 25, 2025 at 6:42 am #1491775Hi,
Thank you for the update.
In the previous thread, the user only needed to edit the Parent or Page Attributes metabox, but they were not modifying or expecting the child pages to inherit the parent page’s URL. Please note that the permalink or slug of portfolio items is automatically generated based on the title. It will not inherit the parent page’s slug or permalink even if you set it as a child page.
Best regards,
IsmaelNovember 25, 2025 at 2:26 pm #1491793Hi,
Is there anyway to achieve that? The reason I want to use hierarchy is to inherit the parent page URL. This way, the submenu URLs could be relative and therefore identical for all recipes: ./ingredients, ./sauce, ./preparation, etc. This would be much easier to build and maintain.
And the reason I was using portfolio items is to use a portfolio grid to display the cook book. I intend to style and filter it like this page:
https://www.photographie-tous-azimuts.com/cours-photo/Best regards,
SergeNovember 26, 2025 at 6:29 am #1491826Hi,
Unfortunately, that is not possible without significant modifications to WordPress. You may need to hire a freelance developer or contact Codeable for this type of customization. Please check the link below.
— https://kriesi.at/contact/customization
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.

