Title: Help retrieving values from ACF custom fields in custom PHP Theme Pattern
Last modified: June 17, 2024

---

# Help retrieving values from ACF custom fields in custom PHP Theme Pattern

 *  Resolved [oliverlister](https://wordpress.org/support/users/oliverlister/)
 * (@oliverlister)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/help-retrieving-values-from-acf-custom-fields-in-custom-php-theme-pattern/)
 * Hi all,
 * I’m struggling to retrieve values from my ACF custom fields in a new custom PHP
   pattern I’ve created for my theme. I have a custom field with the slug ‘test’,
   and I’m trying to retrieve it in the pattern’s code using a ‘get_field’ function.
 * I’ve been adding this pattern to a custom post type (made using CPT UI) called‘
   work’, and only a blank paragraph box has been showing.
 * Any ideas? I **don’t** have ACF Pro (if that’s required in this instance..)
 * > [View post on imgur.com](https://imgur.com/a/cK8kK7G)
 *     ```wp-block-code
       <?php/** * Title: Credits List * Slug: squeake/credits-list * Categories: text * Description: A credit list for a piece of work. */?><!-- wp:group {"align":"wide","layout":{"type":"constrained"}} --><div class="wp-block-group alignwide">    <!-- wp:paragraph {"align":"center","style":{"typography":{"lineHeight":"1"}},"fontSize":"max-23"} -->    <p>        <?php         $text = get_field('test');        echo $text;        ?>    </p>    <!-- /wp:paragraph --></div><!-- /wp:group -->
       ```
   

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

 *  [George Appiah](https://wordpress.org/support/users/gappiah/)
 * (@gappiah)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/help-retrieving-values-from-acf-custom-fields-in-custom-php-theme-pattern/#post-17830055)
 * I recommend asking in the ACF plugin’s own support sub-forum so its authors and
   user community can assist you: [https://wordpress.org/support/plugin/advanced-custom-fields/](https://wordpress.org/support/plugin/advanced-custom-fields/)
 * Good luck!
 *  Moderator [Support Moderator](https://wordpress.org/support/users/moderator/)
 * (@moderator)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/help-retrieving-values-from-acf-custom-fields-in-custom-php-theme-pattern/#post-17831517)
 * Thread continues at [https://wordpress.org/support/topic/retrieving-value-from-acf-custom-field-in-custom-php-theme-pattern/](https://wordpress.org/support/topic/retrieving-value-from-acf-custom-field-in-custom-php-theme-pattern/)

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

The topic ‘Help retrieving values from ACF custom fields in custom PHP Theme Pattern’
is closed to new replies.

## Tags

 * [ACF](https://wordpress.org/support/topic-tag/acf/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [Support Moderator](https://wordpress.org/support/users/moderator/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/help-retrieving-values-from-acf-custom-fields-in-custom-php-theme-pattern/#post-17831517)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
