
-
AuthorPosts
-
July 9, 2025 at 7:47 pm #1486538
Hi : ) I need to enable parent-child hierarchy for portfolio entries. I tried using plugins like custom post type UI but they seem to be conflicting with the already existing Enfold portfolio entry hierarchy.
How do I setup the portfolio items entries, so that the entries can have the parent-child hierarchy option, the same as it is for a page to have a parent-child hierarchy with another page?
July 10, 2025 at 6:20 am #1486563Hey envisageiam,
Thank you for the inquiry.
You can use the avf_portfolio_cpt_args filter to make the portfolio post type hierarchical. You will also find the full post type registration in the enfold/includes/admin/register-portfolio.php file.
function avf_portfolio_cpt_args_mod( $args ) { $args['hierarchical'] = true; return $args; } add_filter( 'avf_portfolio_cpt_args', 'avf_portfolio_cpt_args_mod' );
The default portfolio templates don’t support this out of the box, so you may need to customize them if needed.
Best regards,
IsmaelJuly 10, 2025 at 5:13 pm #1486607Hi – Thank you for your reply.
The code has been added to the bottom of the includes/admin/register-portfolio.php file, but I am still not seeing the option on the product pages to set the parent.
I have added a user login below for your review. Thank you for your help. I’m super grateful for your time!July 11, 2025 at 6:32 am #1486627Hi,
Thank you for the info.
We forgot to include support for page-attributes. The login account doesn’t have administrator rights, so we were not able access the theme file editor. Please try this again:
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' ); });
You should see this after adding the filter:
Best regards,
IsmaelJuly 11, 2025 at 11:20 am #1486646The file has been updated but im still not seeing the option to set a parent portfolio entry/page.
I have updated the credentials to admin for your review : )July 14, 2025 at 6:33 am #1486725Hi,
Thank you for the update.
We tried adding the code to the functions.php file around line 43, but encountered an error afterward. Would you mind posting the FTP details in the private field so we can investigate the issue further? Where exactly did you add the code?
Best regards,
IsmaelJuly 14, 2025 at 4:10 pm #1486744No worries, I fixed it. The Page Attributes/Parent is now showing on the portfolio pages and everything is working correctly.
Thank you for your help : )July 15, 2025 at 5:28 am #1486778 -
AuthorPosts
- The topic ‘Hierarchy for portfolio entries’ is closed to new replies.