Insertin custom field in php code?
-
I’m using this code to display a loop within the main loop:
<?php $my_query = new WP_Query('category_name=<strong>HERE-IS-WHERE-I-WANT-TO-INSERT-CUSTOM-FIELD</strong>&orderby=title&order=asc&showposts=100');while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate=$post->ID;?> <li><?php the_title();?></li> <?php endwhile; ?>
How could I insert a custom field within that php code???
I tried this:<?php $post_title = get_post_meta($post->ID, 'post_title', $single = true); ?>
then inserting
$post_title.
within the code.Didn’t work. There must be a way?
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Insertin custom field in php code?’ is closed to new replies.