Title: Custom Post type field
Last modified: August 31, 2016

---

# Custom Post type field

 *  [responditwebdesign](https://wordpress.org/support/users/responditwebdesign/)
 * (@responditwebdesign)
 * [10 years ago](https://wordpress.org/support/topic/custom-post-type-field/)
 * Hello,
 * I need to output an image from a custom post type which is stored in a field.
   Usually it would be called with: types_render_field(“cover-artwork”, array(“output”
   =>”HTML”));
 * can this be done within the template system you have? Is it generating a loop
   somewhere that I can extend or hook into?
 * thanks.
 * [https://wordpress.org/plugins/gd-mylist/](https://wordpress.org/plugins/gd-mylist/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Osu](https://wordpress.org/support/users/mrnabo/)
 * (@mrnabo)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-field/#post-7264631)
 * I also need to know how to do this – I’m using Advanced Custom Fields to store
   a bunch of data related to a post and need to display some of those fields (these
   are basically custom fields) in my wish list.
 * Would it be possible to add something like this?
 * ##postCustomFieldName##
 * Where ‘CustomFieldName’ returns the get_post_meta()?
 * Thanks for this great plugin by the way!
 * Osu
 *  [Osu](https://wordpress.org/support/users/mrnabo/)
 * (@mrnabo)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-field/#post-7264635)
 * Hey there,
 * I found the answer (at least when using normal custom fields or, in my case, 
   Advanced Custom Fields).
 * If you want to include custom fields, you need to modify the plugin file `gd-
   mylist-code.php` so that you can add your own ##tagName# for use in the plugins
   templates.
 * I’ll try to explain so it’s understandable for someone else seeing this – instructions
   below on what to do.
 * ——————————————————-
    **File: gd-mylist/gd-mylist-code.php**
 * In the `foreach ($posts as $post)` loop, create variables for your custom fields(
   my example uses a soundcloud and gumroad link):
 *     ```
       $postACF_sc =  get_post_meta($postId, 'sc_link', true); // Get soundcloud link
       $postACF_gumroad =  get_post_meta($postId, 'gumroad_url', true); // Get Gumroad link
       ```
   
 * Then, add your own str_replace() functions below the line that says `$html = 
   file_get_contents($templates_html['box_list'].$locale);`
 * i.e:
 *     ```
       $html = str_replace('##postACF_sc##', $postACF_sc, $html);
       $html = str_replace('##postACF_gr##', $postACF_gumroad, $html);
       ```
   
 * This will let you use `##postACF_sc##` and `##postACF_gr##` in the plugin’s template
   files to show your custom fields.
 * **File: gd-mylist/template/box-list.php**
 * I just chose this template file as an example, but you can add your new made 
   tags to the HTML markup here to display them i.e.
 *     ```
       <article class="gd-mylist-box audio-item">
       	##postBtn##
       	<h2>##postTitle##</h2>
       	<a href="##postACF_sc##" class="sc-player audio-item--url">##postTitle## on SoundCloud</a>
       	<a href="##postACF_gr##" class="audio-item--buy btn btn-green" data-product-url="##postACF_gr##">Buy</a>
       	<a href="##postUrl##" class="view-track btn btn-blue">View track</a>
       </article>
       ```
   
 * ——————————————————-
 * That’s what is working for me, although I’m working through a different problem
   now!
 * Cheers,
 * Osu

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom Post type field’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gd-mylist_fbfbfc.svg)
 * [GDMylist](https://wordpress.org/plugins/gd-mylist/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gd-mylist/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gd-mylist/)
 * [Active Topics](https://wordpress.org/support/plugin/gd-mylist/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gd-mylist/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gd-mylist/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Osu](https://wordpress.org/support/users/mrnabo/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/custom-post-type-field/#post-7264635)
 * Status: not resolved