Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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?

    #1486563

    Hey 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,
    Ismael

    #1486607

    Hi – 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!

    #1486627

    Hi,

    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:

    View post on imgur.com

    Best regards,
    Ismael

    #1486646

    The 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 : )

    #1486725

    Hi,

    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,
    Ismael

    #1486744

    No 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 : )

    #1486778

    Hi,

    Great! Glad to know that his has been resolved. Please don’t hesitate to open another thread if you have more questions. Have a nice day.

    Best regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Hierarchy for portfolio entries’ is closed to new replies.