Plugin Author
hunk
(@hunk)
which is the line number where you are putting get? in loop.php
Thread Starter
tom373
(@tom373)
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 🙂
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">→</span>', 'twentyten' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
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).
It also works with images (I have an image and it lists the link to that image).