Title: the_meta()
Last modified: August 20, 2016

---

# the_meta()

 *  Resolved [3Plumes](https://wordpress.org/support/users/3plumes/)
 * (@3plumes)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/the_meta/)
 * I’m building a custom theme, and have a custom field for storing text on pages.
   To display the text in the page templates, I use **<?php the_meta(); ?>**
 * However, when I’m displaying the blog, single.php, 404.php and so forth, nothing
   is displayed since these aren’t used for pages.
 * Is there a way that I can display the custom field values (from pages) randomly?
   Get_post_meta maybe?

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

 *  [Jonas Grumby](https://wordpress.org/support/users/ss_minnow/)
 * (@ss_minnow)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/the_meta/#post-2472298)
 * You can probably find the answer here.
 * [http://codex.wordpress.org/Custom_Fields](http://codex.wordpress.org/Custom_Fields)
 *  [Jonas Grumby](https://wordpress.org/support/users/ss_minnow/)
 * (@ss_minnow)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/the_meta/#post-2472301)
 * Looks like this might do it
 * [http://wordpress.org/extend/plugins/get-custom-field-values/](http://wordpress.org/extend/plugins/get-custom-field-values/)
 * > Find a custom field for the current post, a specified post, a recent post, 
   > or randomly.
 *  Thread Starter [3Plumes](https://wordpress.org/support/users/3plumes/)
 * (@3plumes)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/the_meta/#post-2472313)
 * Thanks for the ideas Jonas. I unfortunately ran out of time and had to do something
   that was far from ideal:
 *     ```
       <?php
       	if(is_home()) {
       		echo 'custom testimonial goes here';
       	} elseif(is_single()) {
       		echo 'custom testimonial goes here';
       	} elseif(is_category()) {
       		echo 'custom testimonial goes here';
       	} elseif(is_archive()){
       		echo 'custom testimonial goes here';
       	} elseif(is_search()) {
       		echo 'custom testimonial goes here';
       	} elseif(is_404()) {
       		echo 'custom testimonial goes here';
       	} else {
       		the_meta();
       	}
       	?>
       ```
   
 * I’ll revisit your suggestions later and see if I can get them to work.
 * Thanks

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

The topic ‘the_meta()’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [3Plumes](https://wordpress.org/support/users/3plumes/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/the_meta/#post-2472313)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
