Title: [Plugin: Magic Fields] Display Custom Fields Content
Last modified: August 19, 2016

---

# [Plugin: Magic Fields] Display Custom Fields Content

 *  Resolved [tom373](https://wordpress.org/support/users/tom373/)
 * (@tom373)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-magic-fields-display-custom-fields-content/)
 * Hello,
 * in the single.php I added the custom field contents into my posts like this
 *     ```
       <div class="entry-content">
         <?php the_content(); ?>
         <ul>
           <?php if ( get('CUSTOM_FIELD_NAME1',TRUE) ) {
            echo "<li>Custom Field Name1: ", get('CUSTOM_FIELD_NAME1'), "</li>";
            }
           ?>
           <?php if ( get('CUSTOM_FIELD_NAME2',TRUE) ) {
            echo "<li>Custom Field Name2: ", get('CUSTOM_FIELD_NAME2'), "</li>";
            }
           ?>
         </ul>
       </div><!-- .entry-content -->
       ```
   
 * This all works fine for the single post view. However, on my front page (showing
   full posts, not excerpts) the content of the custom fields is not displayed.
 * What is my mistake?
 * I am using WP3 with the Twenty Ten theme.
 * Thanks for any help!
 * [http://wordpress.org/extend/plugins/magic-fields/](http://wordpress.org/extend/plugins/magic-fields/)

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

 *  Thread Starter [tom373](https://wordpress.org/support/users/tom373/)
 * (@tom373)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-magic-fields-display-custom-fields-content/#post-1574345)
 *  Plugin Author [hunk](https://wordpress.org/support/users/hunk/)
 * (@hunk)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-magic-fields-display-custom-fields-content/#post-1574634)
 * which is the line number where you are putting get? in loop.php
 *  Thread Starter [tom373](https://wordpress.org/support/users/tom373/)
 * (@tom373)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-magic-fields-display-custom-fields-content/#post-1574689)
 * hunk, thx! I had it in the single.php only – now I put the get in the loop as
   well (the_content) and everything is fine 🙂
 *  [conualfy](https://wordpress.org/support/users/conualfy/)
 * (@conualfy)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-magic-fields-display-custom-fields-content/#post-1574725)
 * I’m having a problem with Magic Fields: it only shows some fields values (I tested
   with numbers) in single.php and in loop.php it does not show any field value.
 * I’m using twentyten theme also.
 * Here is a piece of loop.php with my code. I have another echo there to debug.
   I can send the whole theme if necessary.
 *     ```
       <?php /* How to display all other posts. */ ?>
   
           <?php else : ?>
               <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                   <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
   
                   <div class="entry-meta">
                       <?php twentyten_posted_on(); ?>
                   </div><!-- .entry-meta -->
   
           <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
                   <div class="entry-summary">
                       <?php echo 'xj'.get('Text');//get('Text',1,1,1,get_the_ID())
                       echo get('Pret');//F:
                       ?>
                   </div><!-- .entry-summary -->
           <?php else : ?>
                   <div class="entry-content">
                       <?php echo 'xi'.get('Text');
                       echo get('Pret');//F:
                       //F: the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
                       <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
                   </div><!-- .entry-content -->
           <?php endif; ?>
       ```
   
 *  [conualfy](https://wordpress.org/support/users/conualfy/)
 * (@conualfy)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-magic-fields-display-custom-fields-content/#post-1574726)
 * I’ve checked if WP sees the fields with the_meta() function. I got the complete
   list of custom fields and their values, but I cannot list the texts (in this 
   application Pret is supposed to be a number and it works even if they inserted
   a string in the field).
 *  [conualfy](https://wordpress.org/support/users/conualfy/)
 * (@conualfy)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-magic-fields-display-custom-fields-content/#post-1574727)
 * It also works with images (I have an image and it lists the link to that image).

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

The topic ‘[Plugin: Magic Fields] Display Custom Fields Content’ is closed to new
replies.

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

 * 6 replies
 * 3 participants
 * Last reply from: [conualfy](https://wordpress.org/support/users/conualfy/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-magic-fields-display-custom-fields-content/#post-1574727)
 * Status: resolved