Magic fields not showing all custom fields
-
I’m having a problem with Magic Fields: it only shows some fields values (I tested with numbers, images).
I’m using twentyten theme.
Here is a piece of loop.php with my code. I have an echo(“xi”) there to debug.
<?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">→</span>', 'twentyten' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> <?php endif; ?>
It also works with images (I have an image and it lists the link to that image).
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). This is the return of the_meta() for one of the posts.
* Email: [email protected]
* Moneda: Euro
* Pret: 888
* Localitate: bucuresti
* Telefon: q
* Website: q
* Titlu: s
* Poza_1:
* Text: qIt seems that the wordpress function get_post_meta is not working for those fields. I use it like this in one place and it echoes nothing:
echo get_post_meta($post->ID, ‘Oras’, true);Thanks,
F.
- The topic ‘Magic fields not showing all custom fields’ is closed to new replies.