Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kielie

    (@kielie)

    Yes I have tried those solutions, neither worked!

    Thread Starter kielie

    (@kielie)

    Ok, so after some more digging, I got it to work with this code, I hope it helps someone in future.

    <table width="750">
                        <?php
                        //get children of page 241 and display with custom fields
    
                        $args=array(
                          'post_parent' => 241,
                          'post_type' => 'page',
                        );
                        $my_query = null;
                        $my_query = new WP_Query($args);
                        if( $my_query->have_posts() ) {
    
                          while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
                            <tr>
                                <td><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></td>
    
                                <!-- here I get the 'distDay' custom field's data, assign it to the $meta_one variable and echo it out !-->
                                <?php $meta_one = get_post_meta($post->ID, 'distDay', true); ?>
                                <td><?php echo $meta_one; ?></td>
    
                                <!-- here I get the 'printerOrder' custom field's data, assign it to the $meta_two variable and echo it out !-->
                                <?php $meta_two = get_post_meta($post->ID, 'printerOrder', true); ?>
                                <td><?php echo $meta_two; ?></td>
                            </tr>
                           <?php endwhile; } ?>
                        <?php wp_reset_query();  // Restore global post data stomped by the_post().?>
                    </table>
Viewing 2 replies - 1 through 2 (of 2 total)