How to print custom fields when using GeTPostQuery
-
Hi,
I’m trying to list all custom posts like unordered list. My code looks like:
<ul class="slideshow"> <?php $Q = new GetPostsQuery(); $args = array(); $args['post_type'] = 'slideshow'; $results = $Q->get_posts($args); foreach ($results as $r) { ?> <li class="slide"> <h1 class="slide_title"> <?php print $r['post_title']; ?> </h1> <div class="slide_content"> <?php print $r['post_content'];?> </div> <img src="<?php echo get_custom_field('slideshow_img_one:to_image_src'); ?>" /> <img src="<?php print_custom_field('slideshow_img_two:to_image_src'); ?>" /> </li> <?php } ?> </ul>
But can’t print custom fields – slideshow_img_one and slideshow_img_two.
Can You help me, please.
https://www.ads-software.com/plugins/custom-content-type-manager/
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘How to print custom fields when using GeTPostQuery’ is closed to new replies.