Viewing 5 posts - 1 through 5 (of 5 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 : )

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.