How to put custom fields in a list outside loop
-
I found this useful code (https://www.wprecipes.com/wordpress-how-to-get-custom-fields-outside-the-loop/) for display custom fields post outside loop. It works fine, but I don’t know how to separate every custom fields in list. I tried this code but it don’t work
<div class="data"> <h3>Features</h3> <ul>List <?php global $wp_query; $postid = $wp_query->post->ID; <li>echo get_post_meta($postid, 'price', true);</li> <li>echo get_post_meta($postid, 'place', true);</li> wp_reset_query(); ?></ul> </div>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to put custom fields in a list outside loop’ is closed to new replies.