Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #502671

    Is it possible to add custom fields for portfolio items via child theme?

    I found this:
    https://kriesi.at/support/topic/portfolio-items-custom-fields/

    But it only seems to work with the main template.

    #502772

    Hi kunzi!

    Add this to your child theme functions.php file.

    add_filter( 'avf_portfolio_cpt_args', 'enfold_customization_portfolio_fields', 1 );
    function enfold_customization_portfolio_fields( $args ) {
    	$args['supports'] = array( 'title','thumbnail','excerpt','editor','comments', 'custom-fields' );
    	return $args;
    }

    Regards,
    Elliott

    #502820

    And how do I display added custom field at the portfolio page?

    Or would it be somehow possible to display the content of the custom field next to the page title (on the same row as the breadcrumb)?

    #502928

    Hey!

    Displaying in the breadcrumbs would have to be considered custom work. But to answer your question, you can use the get_post_meta() function, https://developer.wordpress.org/reference/functions/get_post_meta/, to display the custom fields.

    Regards,
    Elliott

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