-
AuthorPosts
-
November 20, 2014 at 1:29 pm #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?
November 20, 2014 at 9:30 pm #354446Hey 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,
ElliottDecember 2, 2014 at 2:53 pm #361445I 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.
December 2, 2014 at 9:36 pm #361781Hey!
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"> →</span>');Cheers!
Elliott-
This reply was modified 10 years, 11 months ago by
Elliott.
December 3, 2014 at 4:55 pm #362243Thanks, 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.
-
This reply was modified 10 years, 11 months ago by
-
AuthorPosts
- The topic ‘Acessing custom fields from Types plugin for portfolio items’ is closed to new replies.
