Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #354260

    Hi,
    I added an extra text field to portfolio items using the Types plugin. Now I want to add a new DIV with the content of this field in the portfolio overview page and in the portfolio detail view for each item.

    http://wp-types.com/documentation/user-guides/displaying-wordpress-custom-fields/

    But where do I place the PHP to access the content of the field?

    #354446

    Hey xhRK2jvC!

    It would probably be easier to use the excerpt for whatever your trying to do but go ahead and send us a link to your portfolio page so we can see how your displaying your posts. You can set your reply as private if you wish.

    Regards,
    Elliott

    #361445

    I am already using the excerpt for other text. This is how it currently looks like:

    And this is how I want it to look:

    I already created an extra field for the portfolio items, I just don’t know which template file I have to edit to access the data.

    #361781

    Hey!

    You can see where we display the excerpt on line 473 in /enfold/config-templatebuilder/avia-shortcodes/portfolio.php.

    $output .= !empty($excerpt) ? "<div class='grid-entry-excerpt entry-content' ".avia_markup_helper(array('context'=>'entry_content','echo'=>false, 'id'=>$the_id, 'custom_markup'=>$custom_markup)).">".$excerpt."</div>" : '';
    

    For the single portfolio view you can find that on line 27 in /enfold/includes/loop-portfolio-single.php.

    the_content(__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span>');
    

    Cheers!
    Elliott

    • This reply was modified 9 years, 11 months ago by Elliott.
    #362243

    Thanks, Elliot. After trial and error I ended up adding this just after the lines you mentioned:

    /enfold/config-templatebuilder/avia-shortcodes/portfolio.php:474:
    $output .= get_post_meta( $entry->ID, "wpcf-fieldname", true );

    /enfold/includes/loop-portfolio-single.php:28:
    echo get_post_meta( get_the_ID(), "wpcf-fieldname", true );

    And it works.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Acessing custom fields from Types plugin for portfolio items’ is closed to new replies.