custom fields problem
-
Hi
can anyone help me with an issue regarding custom fields.I have a file about.php called from sidebar.
Here is the code:<!--about--> <div id="about"> <?php query_posts('pagename=about'); ?> <?php while (have_posts()) : the_post(); $myphoto = get_post_meta($post->ID, "myphoto", TRUE); $mydesc = get_post_meta($post->ID, "mydesc", TRUE); ?> <h3>About Me</h3> <a href="<?php the_permalink() ?>"><img src="<?php echo $myphoto; ?>" alt="<?php bloginfo('blogname'); ?>" title="<?php bloginfo('blogname'); ?>" /></a><span><?php echo $mydesc ;?></span> </div><!--about-end--> <?php endwhile; ?>the custom fields keys are written directly in the file. I got these instructions from a tutorial.
I cant figure out what I need to add into the custom fields to get the content to display.
So far I uploaded an image using the media library, then I created a post, then I added a custom field name “mydesc” and entered the permalink url to the new post as the value for the custom field.
I then added another custom field,name “myphoto” and entered the url to that image as the value (directly pasted in both cases).
The about.php code is present on every page but the content isnt showing.
can anyone give some advice?
The topic ‘custom fields problem’ is closed to new replies.